git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen Sinclair" <radarsat1@gmail.com>
To: "Elijah Newren" <newren@gmail.com>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Johannes Sixt" <j.sixt@viscovery.net>,
	"Jakub Narebski" <jnareb@gmail.com>,
	git@vger.kernel.org
Subject: Re: Unable to clone an ssh repository (with ugly installation-specific workaround)
Date: Wed, 13 Feb 2008 09:17:20 -0500	[thread overview]
Message-ID: <9b3e2dc20802130617m1c260c5fhb923e7a47e770f98@mail.gmail.com> (raw)
In-Reply-To: <51419b2c0802130457g25892543n9db02e681d9605c5@mail.gmail.com>

On Feb 13, 2008 7:57 AM, Elijah Newren <newren@gmail.com> wrote:
> On Feb 12, 2008 3:30 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > 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.

I had this problem as well, and the only solution I found was setting
up my .ssh/environment file.
I guess when you specify a command for ssh, it executes this command
by itself, not within a shell environment.  Usually it is bash that
sources .bashrc and .profile, so you don't get your paths set up.
Unfortunately .ssh/environment is not a scripting environment, so you
have to just specify your full path there, based on what you get when
you echo $PATH from the shell.
Also, this requires putting the following in sshd_config:

PermitUserEnvironment yes

Which, and this is the biter, is not usually a default on most
systems, as far as I can see.. so it could mean bugging the sysadmin
if it's not your machine, which is not always convenient.  Can't see
any alternative though.

Steve

      reply	other threads:[~2008-02-13 14:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12  2:22 Unable to clone an ssh repository (with ugly installation-specific workaround) Elijah Newren
2008-02-12  7:04 ` David Symonds
2008-02-12  8:16 ` Jakub Narebski
2008-02-12  8:37   ` Johannes Sixt
2008-02-12 10:30     ` Johannes Schindelin
2008-02-12 11:28       ` [PATCH] upload-pack: Initialize the exec-path Johannes Sixt
2008-02-12 11:49         ` Johannes Schindelin
2008-02-12 12:45           ` Johannes Schindelin
2008-02-13 13:00             ` Elijah Newren
2008-02-13 12:57       ` Unable to clone an ssh repository (with ugly installation-specific workaround) Elijah Newren
2008-02-13 14:17         ` Stephen Sinclair [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b3e2dc20802130617m1c260c5fhb923e7a47e770f98@mail.gmail.com \
    --to=radarsat1@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=jnareb@gmail.com \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).