Re: post-checkout hook aborts rebase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone,

> Le 9 sept. 2020 à 05:43, Phillip Wood <phillip.wood123@xxxxxxxxx> a écrit :
> 
> Hi Tom
> 
> On 27/08/2020 01:44, Tom Rutherford wrote:
>> Thank you for the response Junio.
>> 
>> For what it's worth, my hook does not make changes to the repo. It's
>> running a command to check that the installed version of our
>> dependencies match the version specified in the commit being checked
>> out, and merely warns if the two don't match (then exits with a
>> nonzero return code).
>> 
>> For this reason it's been convenient that the hook runs during
>> rebases, but I find it surprising that the nonzero return code would
>> impact the rebase.
> 
> If the checkout succeeds that rebase does not print any of checkout's
> output so unfortunately you wouldn't see the message from your hook.

According to git-rebase's doc [1], that's true only for the new "merge" backend,
though, (which would be in use here in 2.28 unless 'rebase.backend' is set to 'apply').

On a slightly related note, I noticed that that part of the documentation is not 100% exact. I states:
"Further, both backends only call the post-checkout hook with the starting point commit of the rebase, 
not the intermediate commits nor the final commit."

but I noticed that in an interactive rebase, the post-checkout hook *is* called for commits
marked as "edit", when the rebase stops to edit them (I haven't checked if it's called when the rebase stops
for other reasons, like conflicts.)

Maybe we should tweak the wording of the doc  ?

Cheers,

Philippe.

[1] https://git-scm.com/docs/git-rebase#_hooks



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux