4

I am having issues setting up gitolite. Server is Mac OS X Server 10.5.8 and client is Mac OS X 10.6.6. Both are running git 1.7.3.4 compiled from source.

I'm following the documentation as best as I can, but it really needs a major overhaul and is confusing in places. I don't think the author dogfooded it.

I used the "root method" installation. The issue is when I run the final step: cd; git clone git@server:gitolite-admin

Here's what's going on from the client side:

tom@client$ ssh git@git.example.com info
hello tom, the gitolite version here is v1.5.8-22-g6bcb5c1
the gitolite config gives you the following access:
     R   W      gitolite-admin
    @R_ @W_     testing
tom@client$ git clone git@git.example.com:gitolite-admin
Cloning into gitolite-admin...
Can't exec "git": No such file or directory at /usr/local/bin/gl-auth-command line 176.
fatal: The remote end hung up unexpectedly

From https://github.com/sitaramc/gitolite/blob/pu/doc/ssh-troubleshooting.mkd

As a result, it's a lot easier to debug. Just run ssh git@server info. If this get you the gitolite version and access info, everything is fine. If it asks you for a password, see the very first section of this document for help.

Thus I conclude that the SSH part of gitolite is properly configured.

Server:

admin@server$ su - git
Password:
git@server$ which git
/usr/local/bin/git
git@server$ which gl-auth-command
/usr/local/bin/gl-auth-command
git@server$ tail -n 2 /usr/local/bin/gl-auth-command 
$repo = "'$REPO_BASE/$repo.git'";
exec("git", "shell", "-c", "$verb $repo") unless $verb eq 'git-init';

git is available on the server as is in the git user's $PATH.

I have used 'tail' to show the last two lines, 175 and 176, as apparently the last line is the one that's failing.

What the heck is wrong? I've been bashing my head into the wall with this.

Khaled
  • 35,688
  • 8
  • 69
  • 98
Shaggy Frog
  • 171
  • 2
  • 10

2 Answers2

3

This looks like it might be the same problem as described here:

gitolite setup on Mac => git-upload-pack: command not found

Interactive sessions don't necessarily have the same environment variables set as non-interactive sessions. Try adding the PATH to git (/usr/local/bin) to a shell init file for the git user that's read in both interactive and non-interactive sessions. If the git user's shell is bash, try ~git/.bashrc .

  • 1
    Interesting. I added a trivial `.bashrc` file to my git user's home directory (essentially, "`export PATH=/usr/local/bin:$PATH`") and that seems to have fixed it. Thanks :) – Shaggy Frog Jan 26 '11 at 21:16
0

You can set the $GIT_PATH variable in the gitolite.rc file if gl-auth-command is unable to locate the git install location. See http://sitaramc.github.com/gitolite/doc/gitolite.rc.html for more info.

It appears that /usr/local/bin/ is not part of $PATH when gl-auth-command is run from ssh so your shell must be adding it when you login normally but not during a non-login non-interactive usage.

Arrowmaster
  • 511
  • 2
  • 5