Re: post-checkout hook aborts rebase
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 27, 2020, 00:22 UTC
- Message-ID
- <xmqq3649szs8.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqq7dtlt080.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> ... If "git rebase" or whatever > command wanted to place files and the index into some state by using > "git checkout" command, and if the post-checkout hook mucked with > the state in such a way that contradicts with what the "git rebase" > command wanted them to be in, it is not surprising the hook's behavior > broke "git rebase"'s operation.
Having said all that, I actually think that "rebase" shouldn't be invoking "git checkout" (and its equivalent) internally when switching to a specific version, in such a way that it would trigger any end-user specified hooks and allow them to muck with the working tree and the index state.
I haven't checked the actual implementation of "git rebase" for quite some time to be sure, but we have lower-level plumbing commands that are not affected by the end-user hooks for exactly that kind of "build higher-level commands by synthesis of lower-level machinery", and it is very possible that what we are looking at is actually a bug that needs to be fixed. I dunno.
Thanks.