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

Re: Unable to clone an ssh repository (with ugly installation-specific workaround)

From
Elijah Newren <newren@gmail.com>
Date
Feb 13, 2008, 12:57 UTC
Message-ID
<51419b2c0802130457g25892543n9db02e681d9605c5@mail.gmail.com>
In-Reply-To
<alpine.LSU.1.00.0802121028290.3870@racer.site>
On Feb 12, 2008 3:30 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 8 quoted lines
> > A quick work-around for Elijah is to add
> >
> >    GIT_EXEC_PATH=/home/enewren/software/install/linux/git/bin
> >
> > to .profile on the remote host.
>
> I guess you meant .bashrc, as .profile is not sourced when using ssh
> transport (it does not spawn a shell) AFAIR.

As far as I can tell, setting paths in .bashrc doesn't really work (or else I'm just doing it wrong). If it did, I would have never hit this bug. Observe the difference between (feel free to replace PATH with GIT_EXEC_PATH; same general result occurs):

  $ ssh localhost
  # Wait for connection to be made, then run
  $ echo $PATH
AND
  $ ssh localhost 'echo $PATH'
AND
  $ ssh localhost 'source .bashrc
  echo $PATH'

The first and the third give the same result, but the second gives something different. It is the second form that git uses, meaning that my paths never get set up.

In my little git wrapper script, I put in some code to work around this little issue and find git-upload-pack for the user if it can (by ssh'ing to the machine and sourcing their .bashrc in the ssh command if necessary; might be a hack, but it makes things nicer for me than always specifying the -u flag).

Cheers, Elijah

Previous: Elijah NewrenNext: Stephen Sinclair
Message 10 of 11 in “Unable to clone an ssh repository (with ugly installation-specific workaround)”
  1. Elijah NewrenFeb 12, 2008
  2. David SymondsFeb 12, 2008
  3. Jakub NarebskiFeb 12, 2008
  4. Johannes SixtFeb 12, 2008
  5. Johannes SchindelinFeb 12, 2008
  6. upload-pack: Initialize the exec-path.Johannes Sixt, Feb 12, 2008
  7. Johannes SchindelinFeb 12, 2008
  8. Johannes SchindelinFeb 12, 2008
  9. Elijah NewrenFeb 13, 2008
  10. Elijah NewrenFeb 13, 2008
  11. Stephen SinclairFeb 13, 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.