Re: commit-msg hook does not run on merge with --no-ff option

2 messages, 2 authors, 2017-09-20 · open the first message on its own page

Re: commit-msg hook does not run on merge with --no-ff option

From: Junio C Hamano <hidden>
Date: 2017-09-15 20:53:19

Joseph Dunne [off-list ref] writes:
Valid point.  The way my project is set up I always get a conflict on
merge operations, so technically all my merges (except fast forward
merges) end with a git-commit, which of course runs the commit-msg
hook.  It seems everything is working as designed.  Shame there isn't
a merge-msg hook.

It seems I have no choice but to work around this issue.  Thanks for your help.
I think Stefan wanted to say in his message upthread that with an
update still in flight you may not need a workaround.

Re: commit-msg hook does not run on merge with --no-ff option

From: Joseph Dunne <hidden>
Date: 2017-09-20 20:09:12

For anyone who stumbles upon this in the future, I found a very simple
workaround to force the commit hooks (including commit-msg) to run
following a merge operation:  Simply create a post-merge hook which
triggers an amended commit with no changes.

post-merge hook:

#!/bin/bash
git commit --amend -C HEAD

On Fri, Sep 15, 2017 at 3:53 PM, Junio C Hamano [off-list ref] wrote:
Joseph Dunne [off-list ref] writes:
quoted
Valid point.  The way my project is set up I always get a conflict on
merge operations, so technically all my merges (except fast forward
merges) end with a git-commit, which of course runs the commit-msg
hook.  It seems everything is working as designed.  Shame there isn't
a merge-msg hook.

It seems I have no choice but to work around this issue.  Thanks for your help.
I think Stefan wanted to say in his message upthread that with an
update still in flight you may not need a workaround.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help