Re: [PATCH] rev-parse --git-path: fix output when running in a subdirectory
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 10, 2017, 15:44 UTC
- Message-ID
- <alpine.DEB.2.20.1702101634010.3496@virtualbox>
- In-Reply-To
- <CANoM8SV7oJ6YmKM-n63620EkODxD562BZnLZB6OvX8O6BmDT1A@mail.gmail.com>
Hi Mike,
On Thu, 9 Feb 2017, Mike Rappazzo wrote:
Show 13 quoted lines
> On Thu, Feb 9, 2017 at 5:54 PM, Junio C Hamano <gitster@pobox.com> wrote: > > > > That leaves what the right single-step behaviour change should be. As > > I recall Duy said something about --common-dir and other things Mike's > > earlier change also covered, I'd prefer to leave it to three of you to > > figure out what the final patch should be. > > > > The tests which I covered in my previous patch [1] addressed the places > where we identified similar problems. We should try to include some > form of those tests. As far as implementation goes in rev-parse, the > version in this thread is probably better that what I had, but it would > need to also be applied to --git-common-dir and --shared-index-path.
Thank you so much for pointing out that git-common-dir and shared-index-path have the same problem.
I looked a little further, and it seems that the show_file() function may have the exact same problem... but then, it only prefixes filenames if the --prefix=<prefix> option has been passed, and it could be argued that those prefixed filenames are *not* meant to be relative to the cwd but to the top-level directory.
Anways, v2 was just sent out, and with Peff's acknowledgement that this fixes a real bug and that hypothetical scripts relying on the buggy behavior were broken beyond repair even without worktrees anyway, I am hopeful that we'll get somewhere.
Ciao, Johannes