threads / discuss / 12070

setup_path()

Subject: setup_path()

## tl;dr

3 messages between Feb 13, 2008 and Feb 14, 2008.

replies: 2people: 2as markdown or json

David Miller· Feb 13, 2008, 12:49 UTC · lore

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· Feb 13, 2008, 20:00 UTC · re: David Miller · lore

Re: setup_path()

David Miller <davem@davemloft.net> writes:
Show 10 quoted lines
> 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· Feb 14, 2008, 01:54 UTC · re: Junio C Hamano · lore

Re: setup_path()

From: Junio C Hamano <gitster@pobox.com>
Date: Wed, 13 Feb 2008 12:00:40 -0800
Show 6 quoted lines
> 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.

← back to recent threads