# setup_path()

3 messages from 2008-02-13 to 2008-02-14. Participants: David Miller, Junio C Hamano.
Thread: https://gitlist.dev/t/12070

## David Miller, 2008-02-13 12:49

Subject: setup_path()
Message-ID: <20080213.044915.123319879.davem@davemloft.net>
URL: https://gitlist.dev/e/20080213.044915.123319879.davem%40davemloft.net

```

Shouldn't stand-alone programs other than git.c itself also call
setup_path()?

I have a problem where if I only install git into my own home
directory ~/bin, I can't send pull requests over SSH to that machine
successfully because the execvp() of "pack-objects" by git-upload-pack
fails due to the PATH not containing "git --exec-dir"

If I add a dummy setup_path(NULL) call to upload-pack.c, it works
fine.

```

## Junio C Hamano, 2008-02-13 20:00

Subject: Re: setup_path()
Message-ID: <7v3arwpqxj.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v3arwpqxj.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080213.044915.123319879.davem@davemloft.net>

```
David Miller <davem@davemloft.net> writes:

> Shouldn't stand-alone programs other than git.c itself also call
> setup_path()?
>
> I have a problem where if I only install git into my own home
> directory ~/bin, I can't send pull requests over SSH to that machine
> successfully because the execvp() of "pack-objects" by git-upload-pack
> fails due to the PATH not containing "git --exec-dir"
>
> If I add a dummy setup_path(NULL) call to upload-pack.c, it works
> fine.

Yeah, Johannes Sixt had a patch to do exactly that earlier

	Message-ID: <47B182C1.60006@viscovery.net>
	http://news.gmane.org/gmane.comp.version-control.git/73651

and I think it is a good idea to apply it.

```

## David Miller, 2008-02-14 01:54

Subject: Re: setup_path()
Message-ID: <20080213.175405.10792562.davem@davemloft.net>
URL: https://gitlist.dev/e/20080213.175405.10792562.davem%40davemloft.net
In-Reply-To: <7v3arwpqxj.fsf@gitster.siamese.dyndns.org>

```
From: Junio C Hamano <gitster@pobox.com>
Date: Wed, 13 Feb 2008 12:00:40 -0800

> Yeah, Johannes Sixt had a patch to do exactly that earlier
> 
> 	Message-ID: <47B182C1.60006@viscovery.net>
> 	http://news.gmane.org/gmane.comp.version-control.git/73651
> 
> and I think it is a good idea to apply it.

Me too.

In fact people can easily end up unintentionally using different
versions of GIT.  For example in my case I had the distribution's GIT
installed in /usr/bin/git et al., then I installed the current
upstream version of GIT in my home directory.

A different version of GIT gets used when you run things locally
vs. doing things remotely over SSH.  And I didn't notice this until I
uninstalled the git-core package on my system.

```
