Re: post-checkout hook aborts rebase

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

 



On Wed, Aug 26, 2020 at 5:48 PM Tom Rutherford <tmrutherford@xxxxxxxxx> 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).

I've run into this before myself.  The core of the bug is that when
`git checkout` runs the post-checkout hook, whatever exit status
that hook has, `git checkout` has the same exit status.

This might be intended as a feature, but if so, the documentation
needs a tweak: the githooks docs say in part

    This hook cannot affect the outcome of git checkout.

If "outcome" includes exit status -- to me, it does -- either the docs
are wrong or the code is wrong.

> 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.

I have to agree with this, too.

(The simplest fix would be to have `git checkout` ignore the status
from the post-checkout hook, of course, and just exit 0 for success.)

Chris



[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