Re: rev-parse --show-toplevel broken during exec'ed rebase?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 16, 2018, 18:14 UTC
- Message-ID
- <xmqqsh4jt5d0.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180713201949.GA17670@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> None of which is too surprising. The root of the bug is in the > conversion to rebase--helper, I think, when presumably we started > setting GIT_DIR at all (but I didn't dig further). Then 09d7b6c6fa fixed > _one_ fallout of that, which was relative paths, but didn't help the > subdirectory case. > > Just reading over this thread, I suspect the simplest fix is to pass > GIT_DIR and GIT_WORK_TREE together, which is almost always the right > thing to do.
Perhaps. Not exporting GIT_DIR (unless the end-user already did to the environment before starting "git rebase"---it would be a bad change to unexport it unconditionally) may probably be a way to make rebase--helper conversion more faithful to the original scripted Porcelain, but I suspect in practice always giving GIT_DIR and GIT_WORK_TREE would work well for many existing hooks.