threads / discuss / 45559

Issue with 2.11.0 and GIT_EXEC_PATH with multiple entries

Subject: Issue with 2.11.0 and GIT_EXEC_PATH with multiple entries

## tl;dr

5 messages between Mar 30, 2017 and Mar 31, 2017.

replies: 4people: 3as markdown or json

Nate Mueller· Mar 30, 2017, 22:39 UTC · lore

I ran into this after upgrading to 2.11.0 through Xcode. I assumed it was a packaging issue but it looks like it's been in the mainline since 1073094f30 (on October 29).

In 2.11.0, git-sh-setup switched it's call of git-sh-i18n from:
. git-sh-i18n
to:
. "$(git --exec-path)/git-sh-i18n"

This fails for me because my GIT_EXEC_PATH is set to "/Library/Developer/CommandLineTools/usr/libexec/git-core:/Users/nate/.git-exec". If I remove the second entry git-sh-setup works just fine.

Am I doing something wrong here? I can't see what but I'm surprised that I'm the first person to hit this.

-- 
Nate Mueller - Head of Engineering - RetailNext - 406-356-6283
Junio C Hamano· Mar 30, 2017, 22:57 UTC · re: Nate Mueller · lore

Re: Issue with 2.11.0 and GIT_EXEC_PATH with multiple entries

Nate Mueller <nate@retailnext.net> writes:
> This fails for me because my GIT_EXEC_PATH is set to
> "/Library/Developer/CommandLineTools/usr/libexec/git-core:/Users/nate/.git-exec".

That environment variable is designed to hold a single path, not like $PATH that lists multiple places in a colon separated list.

Nate Mueller· Mar 30, 2017, 23:00 UTC · re: Junio C Hamano · lore

Re: Issue with 2.11.0 and GIT_EXEC_PATH with multiple entries

Really? My config has been set this way for years and it's never caused problems before. I have subcommands in both of those directories and all work.

On Thu, Mar 30, 2017 at 3:57 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Nate Mueller <nate@retailnext.net> writes:
>
>> This fails for me because my GIT_EXEC_PATH is set to
>> "/Library/Developer/CommandLineTools/usr/libexec/git-core:/Users/nate/.git-exec".
>
> That environment variable is designed to hold a single path, not
> like $PATH that lists multiple places in a colon separated list.
-- 
Nate Mueller - Head of Engineering - RetailNext - 406-356-6283
Jeff King· Mar 30, 2017, 23:32 UTC · re: Nate Mueller · lore

Re: Issue with 2.11.0 and GIT_EXEC_PATH with multiple entries

On Thu, Mar 30, 2017 at 04:00:41PM -0700, Nate Mueller wrote:
> Really?  My config has been set this way for years and it's never
> caused problems before.  I have subcommands in both of those
> directories and all work.

Really. It did happen to work most of the time before (because most uses involved just appending it to $PATH). But it was never intended to work with multiple paths. The:

  . "$(git --exec-path)/git-sh-whatever"

advice has been advertised in the documentation for years. E.g., see bd870878f (Documentation: don't assume git-sh-setup and git-parse-remote are in PATH, 2008-06-29). So even if we wanted to relax the rules in our scripts, it seems like a potential hazard for 3rd party scripts.

The recommended way is to just put your ~/.git-exec into your $PATH.
-Peff
Nate Mueller· Mar 31, 2017, 00:39 UTC · re: Jeff King · lore

Re: Issue with 2.11.0 and GIT_EXEC_PATH with multiple entries

Got it.  Thanks!
On Thu, Mar 30, 2017 at 4:32 PM, Jeff King <peff@peff.net> wrote:
Show 20 quoted lines
> On Thu, Mar 30, 2017 at 04:00:41PM -0700, Nate Mueller wrote:
>
>> Really?  My config has been set this way for years and it's never
>> caused problems before.  I have subcommands in both of those
>> directories and all work.
>
> Really. It did happen to work most of the time before (because most uses
> involved just appending it to $PATH). But it was never intended to work
> with multiple paths. The:
>
>   . "$(git --exec-path)/git-sh-whatever"
>
> advice has been advertised in the documentation for years. E.g., see
> bd870878f (Documentation: don't assume git-sh-setup and git-parse-remote
> are in PATH, 2008-06-29). So even if we wanted to relax the rules in our
> scripts, it seems like a potential hazard for 3rd party scripts.
>
> The recommended way is to just put your ~/.git-exec into your $PATH.
>
> -Peff
-- 
Nate Mueller - Head of Engineering - RetailNext - 406-356-6283

← back to recent threads