Re: Template for commit messages

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Template for commit messages
Date: 2016-01-29 00:33:19
Message-ID: 20160129003319.GA746802@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 the command. This
mechanism can be used by projects that want to guide participants
with some hints on what to 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2016-01-29 01:03:36 Re: [PROPOSAL] VACUUM Progress Checker.
Previous Message Andrew Dunstan 2016-01-29 00:30:58 Re: Template for commit messages