# exec-path behavior

2 messages from 2009-07-30 to 2009-07-30. Participants: Jeffrey Middleton, Sean Estabrooks.
Thread: https://gitlist.dev/t/20299

## Jeffrey Middleton, 2009-07-30 17:00

Subject: exec-path behavior
Message-ID: <4389ce950907301000m5b264771jf87cc06398bee7e0@mail.gmail.com>
URL: https://gitlist.dev/e/4389ce950907301000m5b264771jf87cc06398bee7e0%40mail.gmail.com

```
I'm wondering about the intended behavior of the
--exec-path/GIT_EXEC_PATH option - is it supposed to override or add
to the built-in path?  It seems to do some of both.

$ git --exec-path=foo rebase
git: 'rebase' is not a git-command. See 'git --help'.

but:

$ git --exec-path=foo status
# On branch master
nothing to commit (working directory clean)

There are plenty of commands in each category, and it's not
immediately obvious to me what criteria separate them.  Not a huge
problem, since it's easy enough to use --exec-path=foo:<normal-path>,
but I was in the process of adding support for exec-path to the bash
completion, and it's an important distinction there - and much easier
if it adds to the built-in, of course.


Thanks,
Jeffrey

```

## Sean Estabrooks, 2009-07-30 17:48

Subject: Re: exec-path behavior
Message-ID: <BLU0-SMTP449412ED39DA595CF1527AAE130@phx.gbl>
URL: https://gitlist.dev/e/BLU0-SMTP449412ED39DA595CF1527AAE130%40phx.gbl
In-Reply-To: <4389ce950907301000m5b264771jf87cc06398bee7e0@mail.gmail.com>

```
On Thu, 30 Jul 2009 12:00:29 -0500
Jeffrey Middleton <jefromi@gmail.com> wrote:

> I'm wondering about the intended behavior of the
> --exec-path/GIT_EXEC_PATH option - is it supposed to override or add
> to the built-in path?  It seems to do some of both.
[...]
> There are plenty of commands in each category, and it's not
> immediately obvious to me what criteria separate them.  Not a huge
> problem, since it's easy enough to use --exec-path=foo:<normal-path>,
> but I was in the process of adding support for exec-path to the bash
> completion, and it's an important distinction there - and much easier
> if it adds to the built-in, of course.

Jeffrey,

The commands that are "built-in" and compiled into the git executable
will execute because no searching of the exec-path is necessary.  Any
commands that are compiled into a separate executable will fail since
git can not find them in the incorrect exec-path directory.

If you take a listing of the exec-path directory on your system you'll
see that many commands are hard-linked to the single "git" executable.
The commands that aren't linked to git are external and will be those
that fail when you supply an erroneous exec-path.

Sean

```
