Add a commit template for git commit logs
ClosedPublic

Authored by jrm on Dec 29 2017, 5:22 PM.

Details

Summary

To use the template, see the comments in the file.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jrm created this revision.Dec 29 2017, 5:22 PM
mat added a subscriber: mat.Dec 30 2017, 8:11 AM

You should probably add the instructions on how to use it in the file itself.

krion added a subscriber: krion.Dec 30 2017, 8:28 AM

Shouldn't it be: "git config commit.template .gitmessage" ?

krion added a comment.Dec 30 2017, 8:31 AM
In D13677#286176, @mat wrote:

You should probably add the instructions on how to use it in the file itself.

I agree. It would make sense to put here how-to hook commit-msg with appropriate location and permissions.

jrm updated this revision to Diff 37235.Dec 30 2017, 4:02 PM
  • Describe how to use the git commit template in the template itself
krion added a comment.Dec 30 2017, 8:45 PM

Looks good now, imo.

eadler added a subscriber: eadler.Dec 30 2017, 10:30 PM

Consider just leaving the comment and letting users uncomment lines they want.

jrm updated this revision to Diff 37267.Dec 31 2017, 12:26 AM

Fix commit-msg hook and tweak instructions in git commit template

jrm edited the summary of this revision. (Show Details)Dec 31 2017, 12:31 AM
mat added inline comments.Dec 31 2017, 9:43 AM
.gitmessage
38–54 ↗(On Diff #37267)

Empty fields are already removed by a hook in the repository.

jrm added inline comments.Dec 31 2017, 1:49 PM
.gitmessage
38–54 ↗(On Diff #37267)

I assumed this was (only) implemented in the svn clients we use, based on cleanmsg().

In any case, one first has to commit to git. Would it not be nice for empty fields to be cleaned automatically for the git commits?

jrm updated this revision to Diff 37308.Dec 31 2017, 2:30 PM
  • Fix path to commit-msg hook in git commit template comments
mat added a comment.Dec 31 2017, 10:36 PM

There is no such thing as a "git commit". Commits in git repositories are only transient, and they only last as long as it takes you to commit them to the Subversion repository.

Commit messages are cleaned up by svnadmin/hooks/scripts/log-police.py. So, really, I see no reason to clobber the template with 2. and after.

jrm updated this revision to Diff 37334.Dec 31 2017, 11:16 PM
  • Remove the comments describing the git commit-msg hook
jrm marked 2 inline comments as done.Dec 31 2017, 11:17 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 1 2018, 6:52 PM
Closed by commit rP457790: Add a commit template for git commit logs (authored by jrm, committed by ). · Explain Why
This revision was automatically updated to reflect the committed changes.
mat added inline comments.Jan 2 2018, 11:54 AM
head/.gitattributes
1

Mmmm, I do not understand, will there be more tha one .gitmessage file ?

jrm added inline comments.Jan 2 2018, 5:13 PM
head/.gitattributes
1

This was not really intended. It would only let me git dcommit after git svn propset.., which adds a line to .gitattributes.
What was the right solution here? Committing directly with svn, or maybe adding a line to ~/.subversion/config?

Shall I remove the line?

mat added inline comments.Jan 3 2018, 8:19 AM
head/.gitattributes
1

Mmmm, I think you should commit it with svn directly, I don't see a good way to do it with git without this spam here :/

(Also, try not to add stuff to ~/.subversion/config, it only mostly confuses things.)