Re: [PATCH 1/2] rev-parse: add --filename-prefix option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 8, 2013, 18:11 UTC
- Message-ID
- <7v61zwyjs8.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130408173604.GP2222@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
Show 20 quoted lines
> On Mon, Apr 08, 2013 at 08:07:32AM -0700, Junio C Hamano wrote: >> John Keeping <john@keeping.me.uk> writes: >> >> > Yes (ish), the intended usage is something like this: >> > >> > prefix=$(git rev-parse --show-prefix) >> > cd_to_toplevel >> > ... parse options here ... >> > # Convert remaining arguments (filenames) into top-level paths: >> > eval "set $(git rev-parse --prefix "$prefix" --sq -- "$@")" >> > >> > The "ish" is that my current implementation introduced a new variable >> > instead of simply resetting the existing "prefix" variable, which I >> > assume is what you mean. >> >> This is very sensible. > > Which bit specifically? I assume you agree with the intended usage, but > do you also mean that resetting the prefix returned from > setup_git_directory is the right way to approach this?
My gut feeling says yes, but you can persuade me easily why it is a bad idea if you have an example of why it would not work well.