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

Re: [ANNOUNCE] GIT 1.6.0-rc2

From
JHJan Hudec <bulb@ucw.cz>
Date
Sep 15, 2008, 17:12 UTC
Message-ID
<20080915171240.GB4787@efreet.light.src>
In-Reply-To
<20080913.013330.29519747.davem@davemloft.net>
On Sat, Sep 13, 2008 at 01:33:30 -0700, David Miller wrote:
Show 22 quoted lines
> As a followup this turned out to be the classic "PATH when doing GIT over
> SSH" problem.
> 
> I have to say this is very unfun to debug, and even less fun to "fix"
> even once you know this is the problem.  And what's more I know this is
> the second time I've had to spend a night debugging this very problem.
> 
> I ended up having to make a ~/.ssh/environment file and then restart my
> SSH server with "PermitUserEnvironment yes" added to sshd_config.
> 
> But I can't believe this is what I have to do just to pull from a machine
> where I have GIT only installed in my home directory.  What if I were just
> a normal user and couldn't change the SSHD config?  What hoops would I
> need to jump through to get my PATH setup correctly? :)
> 
> It doesn't even work to put ~/bin into the PATH listed in the system wide
> /etc/environment, because that does not do tilde expansion, SSHD just takes
> it as-is.
> 
> Wouldn't it make sense to put the bindir into PATH when we try to do
> execv_git_cmd()?  The code has already put the gitexecdir into the
> PATH at this point.
I don't think it gets to execv_git_cmd(). Git on local side will run
    ssh <host> git upload-pack
and it's ssh that can't find git in ~/bin (or maybe it's still using the
dashed form for backward compatibility; the argument stands either way).
There are two possible solutions (besides the .ssh/environment one):
 1. Without hacking git: Use a separate key pair for git access and configure
    that key on the server with 'command="/home/you/bin/git-shell"' option in
    .ssh/authorized_keys. Git shell should run the command from exec-dir
    properly.
 2. Hack git to support some variable to set the remote command for ssh
    protocol.
-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
Previous: David MillerNext: David Miller
Message 7 of 8 in “[ANNOUNCE] GIT 1.6.0-rc2”
  1. Junio C HamanoAug 7, 2008
  2. Peter ZijlstraAug 7, 2008
  3. Junio C HamanoAug 7, 2008
  4. Peter ZijlstraAug 7, 2008
  5. David MillerAug 7, 2008
  6. David MillerSep 13, 2008
  7. Jan HudecSep 15, 2008
  8. David MillerSep 15, 2008

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.