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

Re: "fatal: index-pack failed" on git-clone

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 8, 2009, 17:34 UTC
Message-ID
<7vskh76pui.fsf@alter.siamese.dyndns.org>
In-Reply-To
<102A43B8-AD35-4B1D-850C-3642CEDB2864@uchicago.edu>
Fritz Anderson <fritza@uchicago.edu> writes:
Show 22 quoted lines
> Here is the result:
>
> ===
> $ git index-pack
> usage: git index-pack [-v] [-o <index-file>] [{ ---keep | -- 
> keep=<msg> }] [--strict] { <pack-file> | --stdin [--fix-thin] [<pack- 
> file>] }
> $ sudo git index-pack
> usage: git index-pack [-v] [-o <index-file>] [{ ---keep | -- 
> keep=<msg> }] [--strict] { <pack-file> | --stdin [--fix-thin] [<pack- 
> 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
Previous: Fritz AndersonNext: Fritz Anderson
Message 4 of 18 in “"fatal: index-pack failed" on git-clone”
  1. Fritz AndersonJul 8, 2009
  2. Junio C HamanoJul 8, 2009
  3. Fritz AndersonJul 8, 2009
  4. Junio C HamanoJul 8, 2009
  5. Fritz AndersonJul 8, 2009
  6. Junio C HamanoJul 8, 2009
  7. Daniel BarkalowJul 8, 2009
  8. Fritz AndersonJul 8, 2009
  9. Fritz AndersonJul 8, 2009
  10. Johannes SixtJul 8, 2009
  11. Jeff KingJul 8, 2009
  12. Fritz AndersonJul 8, 2009
  13. Johannes SixtJul 9, 2009
  14. Junio C HamanoJul 8, 2009
  15. Jeff KingJul 9, 2009
  16. Michael J GruberJul 9, 2009
  17. A Large Angry SCMJul 9, 2009
  18. Jeff KingJul 13, 2009

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.