Re: Template for commit messages - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Template for commit messages
Date
Msg-id 20160129003319.GA746802@alvherre.pgsql
Whole thread Raw
In response to Re: Template for commit messages  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost wrote:

> > OK, but keep in mind whatever script committers user should remove tags
> > that are empty after exiting the editor.  I can provide the grep regex
> > in git somewhere too:
> > 
> >   egrep -v "^(Author|Reported-by|Bug|Reviewed-by|Tested-by|Backpatch-through): *$"
> 
> If the template is there then, for my part at least, I wouldn't mind
> killing the empty lines.  Having a decent script would work too, of
> course... but I have to admit that I've not tried having a script modify
> my commit messages right before they're committed and, well, it'd take a
> bit for me to be comfortable with it.
> 
> No one wants garbled commit messages from a script that went awry. ;)

Maybe it'd be better to have the lines start with a # , because then
git commit itself removes those as comments.  So the committer would
need to remove the # and then fill in the data for the field.

git-commit(1) says:
      -t <file>, --template=<file>          When editing the commit message, start the editor with the contents
in the given file. The commit.template configuration variable is          often used to give this option implicitly to
thecommand. This          mechanism can be used by projects that want to guide participants          with some hints on
whatto write in the message in what order. If          the user exits the editor without editing the message, the
commit         is aborted. This has no effect when a message is given by other          means, e.g. with the -m or -F
options.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Template for commit messages
Next
From: Amit Langote
Date:
Subject: Re: [PROPOSAL] VACUUM Progress Checker.