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
Unknown Object (File)
Sat, Mar 23, 9:10 AM
Unknown Object (File)
Feb 14 2024, 11:21 PM
Unknown Object (File)
Jan 22 2024, 5:38 PM
Unknown Object (File)
Jan 22 2024, 12:14 AM
Unknown Object (File)
Jan 18 2024, 1:05 PM
Unknown Object (File)
Jan 6 2024, 1:36 AM
Unknown Object (File)
Jan 6 2024, 1:36 AM
Unknown Object (File)
Jan 6 2024, 1:36 AM
Subscribers

Details

Summary

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

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
38–54 ↗(On Diff #37267)

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

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

  • 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

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

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?

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