git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] stop putting argv[0] dirname at front of PATH

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 22, 2015, 18:23 UTC
Message-ID
<CAPig+cR1aAk053Lptq-vpsKtVP2nt9RF9YJxhNSicshEk7Ps7g@mail.gmail.com>
In-Reply-To
<20150422181402.GB3535@peff.net>
On Wed, Apr 22, 2015 at 2:14 PM, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> Subject: stop putting argv[0] dirname at front of PATH
>
> When the "git" wrapper is invoked, we prepend the baked-in
> exec-path to our PATH, so that any sub-processes we exec
> will all find the git-foo commands that match the wrapper
> version.
> [...]
> Given that the main motivation for git pulling the argv[0]
s/pulling/putting/
Show 22 quoted lines
> dirname into the PATH has been broken for years, that the
> remaining cases are obscure and unlikely (and easily fixed
> by the user just setting up their $PATH sanely), and that
> the behavior is hurting real, reasonably common use cases,
> it's not worth continuing to do so.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> diff --git a/exec_cmd.c b/exec_cmd.c
> index 8ab37b5..e85f0fd 100644
> --- a/exec_cmd.c
> +++ b/exec_cmd.c
> @@ -96,7 +96,6 @@ void setup_path(void)
>         struct strbuf new_path = STRBUF_INIT;
>
>         add_path(&new_path, git_exec_path());
> -       add_path(&new_path, argv0_path);
>
>         if (old_path)
>                 strbuf_addstr(&new_path, old_path);
> --
> 2.4.0.rc2.498.g02440db
Previous: Jeff KingNext: Jeff King
Message 9 of 12 in “PATH modifications for git-hook processes”
  1. Matthew RothenbergApr 14, 2015
  2. Junio C HamanoApr 14, 2015
  3. Matthew RothenbergApr 15, 2015
  4. Jeff KingApr 16, 2015
  5. Jeff KingApr 16, 2015
  6. David RodríguezApr 22, 2015
  7. Junio C HamanoApr 22, 2015
  8. stop putting argv[0] dirname at front of PATHJeff King, Apr 22, 2015
  9. Eric SunshineApr 22, 2015
  10. Jeff KingApr 22, 2015
  11. Jonathan NiederApr 22, 2015
  12. Jeff KingApr 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.