Re: rev-parse --show-toplevel broken during exec'ed rebase?
- From
- Vitali Lovich <vlovich@gmail.com>
- Date
- Jul 12, 2018, 02:53 UTC
- Message-ID
- <CAF8PYMikJZF4Qk4VHhAUPB80LG=gjZBVNBu0yGKCLLPpdG_3sg@mail.gmail.com>
- In-Reply-To
- <CAF8PYMjub1KK_ZK0hijTNBACSa6SaFyu1dJgrXd5fJU5Hc_dhg@mail.gmail.com>
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 <vlovich@gmail.com> wrote:
Show 24 quoted lines
> > 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 (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 git repository > > 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 > inconsistency (even with other rebase contexts) & the documentation > says "Show the absolute path of the top-level directory." with no > caveats. > > Thanks, > Vital