# hook for rebase --continue

5 messages from 2011-11-07 to 2011-11-15. Participants: Matt Graham, Martin Fick, Neal Kreitzinger.
Thread: https://gitlist.dev/t/28879

## Matt Graham, 2011-11-07 19:42

Subject: hook for rebase --continue
Message-ID: <CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com>
URL: https://gitlist.dev/e/CALts4TQ545L1d1J0EiUjd7x%3DWBJpjCCv6UsXZOoGQAC29RqC5g%40mail.gmail.com

```
Hi,
I did some testing and it appears that during a rebase, if I resolve a
conflict and call git rebase --continue, the pre-commit hook doesn't
run.  This means that if I don't resolve the conflict correctly, our
check for invalid syntax doesn't get run and creates the risk that
someone could push code with invalid syntax, not realizing that the
check didn't run.

Does anyone else share my expectation that the pre-commit hook should
run during a rebase? Or at least for the first commit following a
rebase conflict?

If not, is there another hook that is triggered by a rebase that I
should be using instead?

Thanks,
Matt

```

## Martin Fick, 2011-11-07 19:46

Subject: Re: hook for rebase --continue
Message-ID: <201111071246.35100.mfick@codeaurora.org>
URL: https://gitlist.dev/e/201111071246.35100.mfick%40codeaurora.org
In-Reply-To: <CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com>

```
On Monday, November 07, 2011 12:42:32 pm Matt Graham wrote:
> Does anyone else share my expectation that the pre-commit
> hook should run during a rebase? Or at least for the
> first commit following a rebase conflict?

I have had the same concern.  We use a change-id hook for 
Gerrit development, and it adds a footer line to commit 
messages.  If during a rebase, it is accidentally removed, 
the hook does not get run and does not re-add it,

-Martin

-- 
Employee of Qualcomm Innovation Center, Inc. which is a 
member of Code Aurora Forum

```

## Neal Kreitzinger, 2011-11-10 00:47

Subject: Re: hook for rebase --continue
Message-ID: <4EBB1F17.4060907@gmail.com>
URL: https://gitlist.dev/e/4EBB1F17.4060907%40gmail.com
In-Reply-To: <CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com>

```
On 11/7/2011 1:42 PM, Matt Graham wrote:
> I did some testing and it appears that during a rebase, if I resolve
> a conflict and call git rebase --continue, the pre-commit hook
> doesn't run.  This means that if I don't resolve the conflict
> correctly, our check for invalid syntax doesn't get run and creates
> the risk that someone could push code with invalid syntax, not
> realizing that the check didn't run.
>
> Does anyone else share my expectation that the pre-commit hook
> should run during a rebase? Or at least for the first commit
> following a rebase conflict?
>
> If not, is there another hook that is triggered by a rebase that I
> should be using instead?
>
You could try creating an alias (e.g. "git rebase-continue") in your 
gitconfig that runs the desired validation logic and then executes git 
rebase.  Then you would run "git rebase-continue" instead of "git rebase 
--continue".

v/r,
neal

```

## Neal Kreitzinger, 2011-11-10 00:50

Subject: Re: hook for rebase --continue
Message-ID: <4EBB1FDE.7020006@gmail.com>
URL: https://gitlist.dev/e/4EBB1FDE.7020006%40gmail.com
In-Reply-To: <4EBB1F17.4060907@gmail.com>

```
On 11/9/2011 6:47 PM, Neal Kreitzinger wrote:
> On 11/7/2011 1:42 PM, Matt Graham wrote:
>> I did some testing and it appears that during a rebase, if I resolve
>> a conflict and call git rebase --continue, the pre-commit hook
>> doesn't run. This means that if I don't resolve the conflict
>> correctly, our check for invalid syntax doesn't get run and creates
>> the risk that someone could push code with invalid syntax, not
>> realizing that the check didn't run.
>>
>> Does anyone else share my expectation that the pre-commit hook
>> should run during a rebase? Or at least for the first commit
>> following a rebase conflict?
>>
>> If not, is there another hook that is triggered by a rebase that I
>> should be using instead?
>>
> You could try creating an alias (e.g. "git rebase-continue") in your
> gitconfig that runs the desired validation logic and then executes git
> rebase --continue. Then you would run "git rebase-continue" instead of "git rebase
> --continue".
>
correction: added the --continue option in the alias example above.

--neal

```

## Neal Kreitzinger, 2011-11-15 23:28

Subject: Re: hook for rebase --continue
Message-ID: <4EC2F58C.9020202@gmail.com>
URL: https://gitlist.dev/e/4EC2F58C.9020202%40gmail.com
In-Reply-To: <CALts4TQ545L1d1J0EiUjd7x=WBJpjCCv6UsXZOoGQAC29RqC5g@mail.gmail.com>

```
On 11/7/2011 1:42 PM, Matt Graham wrote:
> Hi, I did some testing and it appears that during a rebase, if I
> resolve a conflict and call git rebase --continue, the pre-commit
> hook doesn't run.  This means that if I don't resolve the conflict
> correctly, our check for invalid syntax doesn't get run and creates
> the risk that someone could push code with invalid syntax, not
> realizing that the check didn't run.
>
> Does anyone else share my expectation that the pre-commit hook
> should run during a rebase? Or at least for the first commit
> following a rebase conflict?
>
> If not, is there another hook that is triggered by a rebase that I
> should be using instead?
>
I just noticed there is a post-rewrite hook in the manpage
http://schacon.github.com/git/githooks.html.  Maybe this does what you want.

v/r,
neal

```
