# hooks not fired by a merge's auto-commit

3 messages from 2010-07-29 to 2010-08-01. Participants: Richard Bronosky, Junio C Hamano, Jay Soffian.
Thread: https://gitlist.dev/t/24565

## Richard Bronosky, 2010-07-29 01:25

Subject: hooks not fired by a merge's auto-commit
Message-ID: <AANLkTindr-y0uAu46FVEqtB5BLw9ZjB0y0ETwmW+8+PV@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTindr-y0uAu46FVEqtB5BLw9ZjB0y0ETwmW%2B8%2BPV%40mail.gmail.com

```
Using git 1.7.1 it seems that a merge (more specifically the
auto-commit) does not fire any of the following hooks:
pre-commit  prepare-commit-msg commit-msg

Is that by design?
Would it be folly to try to patch that behavior?

I humbly request your input before I go trying to "correct" this behavior.

-- 
.!# RichardBronosky #!.

```

## Junio C Hamano, 2010-07-29 16:50

Subject: Re: hooks not fired by a merge's auto-commit
Message-ID: <7vzkxatepy.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzkxatepy.fsf%40alter.siamese.dyndns.org
In-Reply-To: <AANLkTindr-y0uAu46FVEqtB5BLw9ZjB0y0ETwmW+8+PV@mail.gmail.com>

```
Richard Bronosky <Richard@Bronosky.com> writes:

> Using git 1.7.1 it seems that a merge (more specifically the
> auto-commit) does not fire any of the following hooks:
> pre-commit  prepare-commit-msg commit-msg
>
> Is that by design?

I would probably call it an unintended design that now has long been
established that changing it may break people's existing setups rather
badly.

Especially pre-commit hooks that look for and prevent common mistakes from
happening for individual developers may not want to run, when you are
pulling in other people's work that already has the mess they created.
Such problems are often either too late to fix or you are in no position
to reject their pull requests.  So you would break _my_ workflow (and
others who play similar roles as me, making changes themselves and merging
others work) if you did such a change.

You _could_ add pre-merge to introduce it as a new feature.  For people
who want to apply the same check for merges and individual commits
(e.g. those who never merge other's work), pre-merge can just invoke
pre-commit.

```

## Jay Soffian, 2010-08-01 23:27

Subject: Re: hooks not fired by a merge's auto-commit
Message-ID: <AANLkTikXRRB4nqWP1VEUv2V86bR4MRr2PE0MQp_PvPRC@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikXRRB4nqWP1VEUv2V86bR4MRr2PE0MQp_PvPRC%40mail.gmail.com
In-Reply-To: <7vzkxatepy.fsf@alter.siamese.dyndns.org>

```
On Thu, Jul 29, 2010 at 12:50 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Richard Bronosky <Richard@Bronosky.com> writes:
>
>> Using git 1.7.1 it seems that a merge (more specifically the
>> auto-commit) does not fire any of the following hooks:
>> pre-commit  prepare-commit-msg commit-msg
>>
>> Is that by design?
>
> I would probably call it an unintended design that now has long been
> established that changing it may break people's existing setups rather
> badly.
>
> Especially pre-commit hooks that look for and prevent common mistakes from
> happening for individual developers may not want to run, when you are
> pulling in other people's work that already has the mess they created.
> Such problems are often either too late to fix or you are in no position
> to reject their pull requests.  So you would break _my_ workflow (and
> others who play similar roles as me, making changes themselves and merging
> others work) if you did such a change.
>
> You _could_ add pre-merge to introduce it as a new feature.  For people
> who want to apply the same check for merges and individual commits
> (e.g. those who never merge other's work), pre-merge can just invoke
> pre-commit.

Also see http://thread.gmane.org/gmane.comp.version-control.git/151297/

j.

```
