Subject: Re: [PATCH 3/3] templates: detect messages that contain a separator line

From: Junio C Hamano <[email-masked]>
Date: Sun, 08 Feb 2026 16:17:36 -0800

"Kristoffer Haugsbakk" <[email-masked]> writes:

>> A saving grace is that when the user is stopped with this,
>> pre-commit hook that inspects the contents to be committed
>> have already run successfully, so rerunning with "--no-verify"
>> is not with too much risk.  But still, I am not sure if this is a
>> good thing to do overall.
>
> Maybe this is not the right tool[1] but perhaps the hook could respect
> an env. variable to disable this check and hint about it in the error
> output?

It is merely a sample script shipped with the rest of Git, so people
can choose to install better alternatives.  I think it is fine to
keep the sample script simple and understandable.

It however is still a little worrysome that the behaviour of the
sample commit-msg hook updated with the third patch may be used
against helpful suggestions people in projects that employ the
e-mail based workflow may make to their colleages to deliberately
commit a three-dash line followed by material not meant for the
commit log proper, which is a useful trick if you are making your
commits to be sent over e-mail and never to be merged directly to
your target branch.