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

3 messages, 3 authors, 2017-07-01 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2017-07-01 17:37:00

Kaartic Sivaraam [off-list ref] writes:
quoted
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?
Actually I was wondering if it is a good idea to remove it, as it
seems to have outlived its usefulness.

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

From: Philip Oakley <hidden>
Date: 2017-07-01 18:41:01

From: "Junio C Hamano" <redacted>
Kaartic Sivaraam [off-list ref] writes:
quoted
quoted
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?
Actually I was wondering if it is a good idea to remove it, as it
seems to have outlived its usefulness.
Personally, I like the comfort of seeing the Conflicts: list, but if others 
have indicated otherwise...
--
Philip 

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

From: Kaartic Sivaraam <hidden>
Date: 2017-07-01 18:52:17

On Sat, 2017-07-01 at 10:36 -0700, Junio C Hamano wrote:
Actually I was wondering if it is a good idea to remove it, as it
seems to have outlived its usefulness.
It does seem  to be a good idea but it would leave the 'prepare-commit-
msg' hook with no scripts that could be used by just activating it.
That's why I thought of adding a script that removes the "Please enter
your.." message from the comments if it exists. A typical patch will
follow.

Enabling the "prepare-commit-msg" hook with the patch that follows
would do have following result,

Before,

    # Please enter the commit message for your changes. Lines starting
    # with '#' will be ignored, and an empty message aborts the commit.
    # On branch hook-test-merge
    # Changes to be committed:
    #    	    new file:   commit-msg
    #

After,


    # On branch hook-test-merge
    # Changes to be committed:
    #    	    new file:   commit-msg
    #


A typical consequence for "git commit --amend" would be,

Before,

    Test commit

    # Please enter the commit message for your changes. Lines starting
    # with '#' will be ignored, and an empty message aborts the commit.
    #
    # Date:      Sun Jul 2 00:11:28 2017 +0530


After,

    Test commit

    #
    # Date:      Sun Jul 2 00:11:28 2017 +0530
    #
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help