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

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

From
FAFritz Anderson <fritza@uchicago.edu>
Date
Jul 8, 2009, 21:27 UTC
Message-ID
<47A38129-92A6-4CA5-8B79-E93CE9BF867B@uchicago.edu>
In-Reply-To
<20090708211201.GA21600@coredump.intra.peff.net>
On Jul 8, 2009, at 4:12 PM, Jeff King wrote:
Show 7 quoted lines
>  1. Hardlinking "git" into exec-path. That means we will always be  
> able
>     to find the wrapper, even if the PATH has been munged. Admittedly,
>     it sounds far fetched to me that something would exec from the  
> PATH
>     and then munge the PATH afterwards, but that seems to be what sudo
>     is doing (and it is pretty commonly used).
Here's an interesting experiment (RHEL 5):

===== $ echo $PATH /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/fritza/bin $ cat >tryme.sh echo $PATH $ chmod a+x tryme.sh $ sudo ./tryme.sh /usr/bin:/bin

$ sudo git --exec-path /usr/local/libexec/git-core $ cat >tryme.sh git --exec-path $ ./tryme.sh /usr/local/libexec/git-core $ sudo ./tryme.sh ./tryme.sh: line 1: git: command not found =====

That is to say, possibly there is some sudo magic that uses the invoker's PATH to find the command in the first argument. After that, however, PATH is a "safe" value. So if you invoke git via sudo, it will internally see a PATH different from the one at the time of invocation.

For what it's worth.
	— F
Previous: Jeff KingNext: Johannes Sixt
Message 12 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.