Page MenuHomeFreeBSD

Add a commit template for git commit logs
ClosedPublic

Authored by jrm on Dec 29 2017, 5:22 PM.
Tags
None
Referenced Files
F102835092: D13677.id37235.diff
Sun, Nov 17, 7:08 PM
Unknown Object (File)
Oct 4 2024, 7:37 PM
Unknown Object (File)
Oct 4 2024, 5:05 AM
Unknown Object (File)
Oct 3 2024, 2:18 PM
Unknown Object (File)
Oct 3 2024, 8:52 AM
Unknown Object (File)
Oct 1 2024, 7:10 PM
Unknown Object (File)
Oct 1 2024, 6:10 PM
Unknown Object (File)
Oct 1 2024, 1:59 PM
Subscribers

Details

Summary

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

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 13998
Build 14191: arc lint + arc unit

Event Timeline

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

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

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.

  • Describe how to use the git commit template in the template itself

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

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

.gitmessage
39–55

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

.gitmessage
39–55

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?

  • Fix path to commit-msg hook in git commit template comments

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.

  • 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
This revision was automatically updated to reflect the committed changes.
head/.gitattributes
1 ↗(On Diff #37363)

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

head/.gitattributes
1 ↗(On Diff #37363)

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?

head/.gitattributes
1 ↗(On Diff #37363)

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.)