From: Junio C Hamano Date: Wed, 08 Jul 2009 17:34:29 GMT Subject: Re: "fatal: index-pack failed" on git-clone Message-ID: <7vskh76pui.fsf@alter.siamese.dyndns.org> In-Reply-To: <102A43B8-AD35-4B1D-850C-3642CEDB2864@uchicago.edu> Fritz Anderson writes: > Here is the result: > > === > $ git index-pack > usage: git index-pack [-v] [-o ] [{ ---keep | -- > keep= }] [--strict] { | --stdin [--fix-thin] [ file>] } > $ sudo git index-pack > usage: git index-pack [-v] [-o ] [{ ---keep | -- > keep= }] [--strict] { | --stdin [--fix-thin] [ file>] } > === > > So git is apparently found. HOWEVER, if I do this, it's a different > story: > > === > $ which git > /usr/local/bin/git > $ sudo which git > which: no git in (/usr/bin:/bin) > === I was told sudo does this path munging for security reasons (I do not use it personally) but it appears that it does _not_ do that for finding the top level command in "sudo $command $args". Very interesting. Which makes the initial "sudo git clone..." find git in _your_ path before sanitization (and that is why it even starts), but then the path is nuked for the git process it launches, and we cannot find git-index-pack on the PATH. But this should be fine, as git is expected to find git-index-pack in its GIT_EXEC_PATH that is compiled in the binary of "git" itself. Which makes me suspect that your "git" in /usr/local/bin may be misconfigured. You might want to check what these tell you. $ git --exec-path $ /usr/local/bin/git --exec-path