Re: [PATCH] hooks: add signature to the top of the commit message
- From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
- Date
- Jul 1, 2017, 18:52 UTC
- Message-ID
- <1498935127.11617.1.camel@gmail.com>
- In-Reply-To
- <xmqqfuegnjnt.fsf@gitster.mtv.corp.google.com>
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 +0530After,
Test commit
#
# Date: Sun Jul 2 00:11:28 2017 +0530
#