Re: [PATCH] git-commit: add a prepare-commit-msg hook
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 18, 2008, 16:06 UTC
- Message-ID
- <alpine.LSU.1.00.0801181605020.5731@racer.site>
- In-Reply-To
- <4790CAF7.5010908@gnu.org>
Hi,
On Fri, 18 Jan 2008, Paolo Bonzini wrote:
Show 14 quoted lines
> > > > The prepare-commit-msg hook is run whenever a "fresh" commit message > > > (i.e. not one taken from another commit with -c) is shown in the > > > editor. It can modify the commit message in-place and/or abort the > > > commit. > > > > > > While the default hook just adds a Signed-Off-By line at the bottom > > > of the commit messsage, the hook is more intended to build a > > > template for the commit message following project standards. > > > > Would it not be much better for that hook to verify that the template > > has not been added? > > I fail to parse this.
What I meant is this:
In the message hook, just grep if the template was already added. If it was, just return. If it was not, add it.
No need for yet another hook.
Ciao, Dscho