Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-19 Thread Junio C Hamano
SZEDER Gábor writes: >> Forgetting the code in git-sh-setup, are we? >> >> git_dir_init() rather specifically set GIT_DIR to the absolute path, and >> since that variable is already exported, the `exec` commands launched via >> `git-rebase--interactive` all saw it. >> >> That is the reason why

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-19 Thread SZEDER Gábor
> On Mon, 16 Jul 2018, Junio C Hamano wrote: > > > Jeff King writes: > > > > > 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 >

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-19 Thread Johannes Schindelin
Hi Junio, On Mon, 16 Jul 2018, Junio C Hamano wrote: > Jeff King writes: > > > 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 > >

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-16 Thread Junio C Hamano
Jeff King writes: > On Mon, Jul 16, 2018 at 11:14:51AM -0700, Junio C Hamano wrote: > >> Porcelain, but I suspect in practice always giving GIT_DIR and >> GIT_WORK_TREE would work well for many existing hooks. > > Yeah, that may be an option. I don't remember if this was discussed in > this

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-16 Thread Jeff King
On Mon, Jul 16, 2018 at 11:14:51AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > 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

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-16 Thread Junio C Hamano
Jeff King writes: > 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

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-13 Thread brian m. carlson
On Fri, Jul 13, 2018 at 04:19:49PM -0400, Jeff King wrote: > 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. I agree. I'll write up a patch. -- brian m. carlson: Houston, Texas, US

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-13 Thread Jeff King
On Fri, Jul 13, 2018 at 06:47:32PM +, brian m. carlson wrote: > > >> git rebase 18404434bf406f6a6f892ed73320c5cf9cc187dd -x "(cd xdiff; git > > >> rev-parse --show-toplevel)" > > > ... path to git repository/xdiff !!! > > > > > > This seems like incorrect behaviour to me since it's a weird >

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-13 Thread brian m. carlson
On Thu, Jul 12, 2018 at 08:23:02AM -0700, Junio C Hamano wrote: > Vitali Lovich writes: > > > Repro (starting with cwd within git project): > >> (cd xdiff; git rev-parse --show-toplevel) > > ... path to git repository > >> git rebase -i 18404434bf406f6a6f892ed73320c5cf9cc187dd > > # Stop at some

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-12 Thread Vitali Lovich
On Thu, Jul 12, 2018 at 8:23 AM Junio C Hamano wrote: > > Vitali Lovich writes: > > > Repro (starting with cwd within git project): > >> (cd xdiff; git rev-parse --show-toplevel) > > ... path to git repository > >> git rebase -i 18404434bf406f6a6f892ed73320c5cf9cc187dd > > # Stop at some commit

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-12 Thread Junio C Hamano
Vitali Lovich writes: > Repro (starting with cwd within git project): >> (cd xdiff; git rev-parse --show-toplevel) > ... path to git repository >> git rebase -i 18404434bf406f6a6f892ed73320c5cf9cc187dd > # Stop at some commit for editing >> (cd xdiff; git rev-parse --show-toplevel) > ... path to

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-12 Thread Johannes Schindelin
Hi, On Thu, 12 Jul 2018, Johannes Schindelin wrote: > On Wed, 11 Jul 2018, Vitali Lovich wrote: > > > On Wed, Jul 11, 2018 at 7:50 PM Vitali Lovich wrote: > > > > > > Typically git rev-parse --show-toplevel prints the folder containing > > > the .git folder regardless what subdirectory one is

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-12 Thread Johannes Schindelin
Hi Vitali, [please avoid top-posting on this mailing list] On Wed, 11 Jul 2018, Vitali Lovich wrote: > On Wed, Jul 11, 2018 at 7:50 PM Vitali Lovich wrote: > > > > Typically git rev-parse --show-toplevel prints the folder containing > > the .git folder regardless what subdirectory one is in.

Re: rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-11 Thread Vitali Lovich
Sorry. Forgot to include the git versions I tested with (2.13.1, 2.17.0, 2.18.0) On Wed, Jul 11, 2018 at 7:50 PM Vitali Lovich wrote: > > Typically git rev-parse --show-toplevel prints the folder containing > the .git folder regardless what subdirectory one is in. One exception > I have found

rev-parse --show-toplevel broken during exec'ed rebase?

2018-07-11 Thread Vitali Lovich
Typically git rev-parse --show-toplevel prints the folder containing the .git folder regardless what subdirectory one is in. One exception I have found is that if one is within the context of git rebase --exec then show-toplevel always just prints the current directory it's running from. Repro