From: Junio C Hamano <gitster@pobox.com>
To: Paolo Bonzini <bonzini@gnu.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/4] git-commit: add a prepare-commit-msg hook
Date: Mon, 04 Feb 2008 19:08:45 -0800 [thread overview]
Message-ID: <7vk5lkgkw2.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 5840dd34338023e3af8446241a63927d18772f62.1200933409.git.bonzini@gnu.org
Paolo Bonzini <bonzini@gnu.org> writes:
> It takes two parameters. The first is the source of the commit
> message, and can be: `message` (if a `\-m` or `\-F` option was
> given); `template` (if a `\-t` option was given or the
> configuration option `commit.template` is set); `merge` (if the
> commit is a merge or a `.git/MERGE_MSG file exists); `squash`
> (if a `.git/SQUASH_MSG file exists); or a commit id (if a
> `\-c`, `\-C` or `\--amend` option was given). The second
> parameter if the name of the file that the commit log message.
Please do without funny mark-ups. The commit log is not
AsciiDoc.
> The hook is not suppressed by the `\--no-verify` option. However,
> exiting with non-zero status only aborts the commit if said option
> is not given to `git-commit`.
I do not understand why. I do understand that you do not want
to bypass prepare-commit-msg with or without --no-verify,
because this hook is not about input validation but about input
preparation. But I do not understand why a failure exit from it
should be treated any differently with or without --no-verify?
If you want to be strict and be safe catching a breakage in the
prepare-commit-msg hook, you should always abort. You could
also choose to ignore. In either case, shouldn't the validation
be left to pre-commit hook (for the tree) and commit-msg hook
(for the message, that is left after this hook)?
> While the default hook just adds a Signed-Off-By line at the bottom
It's "s/[OB]/ob/;", and ...
> of the commit messsage, the hook is more intended to build a template
> for the commit message following project standards, that the user
> can then edit or discard altogether.
>
> Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
... you know it ;-)
next prev parent reply other threads:[~2008-02-05 3:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-21 14:27 [PATCH] git-commit: add a prepare-commit-msg hook Paolo Bonzini
2008-01-21 14:02 ` [PATCH 1/4] git-commit: support variable number of hook arguments Paolo Bonzini
2008-02-04 16:43 ` Johannes Schindelin
2008-02-05 3:09 ` Junio C Hamano
2008-01-21 14:06 ` [PATCH 2/4] git-commit: set GIT_EDITOR=: if editor will not be launched Paolo Bonzini
2008-01-21 14:27 ` [PATCH 4/4] git-commit: add a prepare-commit-msg hook Paolo Bonzini
2008-02-05 3:08 ` Junio C Hamano [this message]
2008-01-21 14:33 ` [PATCH 3/4] git-commit: Refactor creation of log message Paolo Bonzini
2008-02-04 16:48 ` Johannes Schindelin
2008-02-04 17:14 ` Paolo Bonzini
2008-02-05 1:39 ` Junio C Hamano
2008-02-05 4:07 ` Junio C Hamano
2008-02-05 6:07 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vk5lkgkw2.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=bonzini@gnu.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).