Re: [PATCH] Fix relative built-in paths to be relative to the command invocation
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 14, 2008, 19:03 UTC
- Message-ID
- <7vy744ffuo.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <200807142054.35027.johannes.sixt@telecom.at>
Johannes Sixt <johannes.sixt@telecom.at> writes:
Show 37 quoted lines
> On Montag, 14. Juli 2008, Johannes Schindelin wrote: >> Hi, >> >> On Mon, 14 Jul 2008, Johannes Sixt wrote: >> > Zitat von Johannes Schindelin <Johannes.Schindelin@gmx.de>: >> > > On Sun, 13 Jul 2008, Johannes Sixt wrote: >> > > > @@ -84,7 +90,7 @@ static void add_path(struct strbuf *out, const char >> > > > *path) >> > > > } >> > > > } >> > > > >> > > > -void setup_path(const char *cmd_path) >> > > > +void setup_path(void) >> > > >> > > It seems to me that this patch would not do anything different, but >> > > with less code change, if setup_path() would set argv0_path, and not a >> > > new function was introduced. >> > >> > This is just to play a safe game. I had it that way, but I decided to >> > have the call to the new git_set_argv0_path() early in git.c because the >> > call to setup_path() in git.c is very late, and it could happen that we >> > call system_path() (which needs argv0_path) before that. Although I >> > didn't audit the code whether this really happens. >> >> Well, okay... I would have rather seen it not change (since there was no >> bug to fix), or as a separate patch, but it's Junio's call. > > I investigated this, and, yes, there indeed are calls to system_path() before > setup_path(), for example: > > commit_pager_choice > setup_pager > git_config > git_etc_gitconfig > system_path(ETC_GITCONFIG) > > Junio, do you want git_set_argv0_path() in a separate patch?
I think that would be easier to explain in the commit log what is going on, if it is a separate patch.