Subject: Re: [PATCH] hooks: add signature to the top of the commit message

From: Kaartic Sivaraam <[email-masked]>
Date: Sat, 01 Jul 2017 19:45:46 +0530

On Fri, 2017-06-30 at 09:44 -0700, Junio C Hamano wrote:
> It does look like a hack.  I was wondering if "interpret-trailers"
> is mature enough and can be used for this by now.
It does look promising except for a few differences from the hook which
I'll explain in the following mail.

>  Also the big
> comment before these examples say that this one you are updating is
> "rarely a good idea", though.
I think the comment specifies the "editability" of the sign-off
drawback but AFAIK there's no way as of now to add such trailers to
commit messages. Until there's a solution for adding trailers that
aren't editable manually, I think it's not a bad idea to use a hook for
it and rely on the user to be true to their  conscience. Moreover the
script is commented out by default anyway.

The portion of the hook for adding sign-off could be removed in case
any configuration to enable "-s" option for "git commit" by default
existed. I'm not aware of any.

> By the way, the one that is still actually enabled is no longer
> needed.  The commit template generated internally was corrected some
> time ago not to add the "Conflicts:" section without commenting it
> out.
> 
I'll send in another patch that removes it but it seems removing it
would leave sample hook without anything turned on by default. That
doesn't sound fine, does it? 

Any other possible tweaks that could be done to the commit message
using the "prepare-commit-msg" hook, that's not done by git, and could
be left uncommented by default?

How about a script that removes the "Please enter your.." message from
the comments if it exists?

> Have you tried "merge", "cherry-pick" and "commit --amend" with this
> patch on (meaning, with the "add sob at the top" logic in your actual
> hook that is enabled in your repository)?
> 
Yes, they don't work with this patch. I have dropped it. More on it in
the following mail.