git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Joseph Dunne <jdunne525@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>,
	Stefan Beller <sbeller@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: commit-msg hook does not run on merge with --no-ff option
Date: Wed, 20 Sep 2017 15:09:04 -0500	[thread overview]
Message-ID: <CAC7pkbTU9Ts01p8kDJXqzk2yy=8Y-8dmkGhAkJ96m4D5zCzdRQ@mail.gmail.com> (raw)
In-Reply-To: <xmqq7ewzwuo6.fsf@gitster.mtv.corp.google.com>

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 <gitster@pobox.com> wrote:
> Joseph Dunne <jdunne525@gmail.com> 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.

      reply	other threads:[~2017-09-20 20:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 14:34 commit-msg hook does not run on merge with --no-ff option Joseph Dunne
2017-09-11 17:25 ` Stefan Beller
2017-09-12 18:24   ` Joseph Dunne
2017-09-15  1:50     ` Kaartic Sivaraam
2017-09-15 13:19       ` Joseph Dunne
2017-09-15 20:53         ` Junio C Hamano
2017-09-20 20:09           ` Joseph Dunne [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC7pkbTU9Ts01p8kDJXqzk2yy=8Y-8dmkGhAkJ96m4D5zCzdRQ@mail.gmail.com' \
    --to=jdunne525@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaarticsivaraam91196@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).