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

Re: git-index-pack really does suck..

From
Nicolas Pitre <nico@cam.org>
Date
Apr 3, 2007, 20:53 UTC
Message-ID
<alpine.LFD.0.98.0704031639470.28181@xanadu.home>
In-Reply-To
<7vbqi5w62c.fsf@assigned-by-dhcp.cox.net>
On Tue, 3 Apr 2007, Junio C Hamano wrote:
Show 13 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
> 
> > That whole "verify no SHA1 hash collision" code is really pretty damn 
> > paranoid. Maybe we shouldn't have it enabled by default.
> >
> > So how about this updated patch? We could certainly make "git pull" imply 
> > "--paranoid" if we want to, but even that is likely pretty unnecessary. 
> > It's not like anybody has ever shown a SHA1 collision, and if the *local* 
> > repository is corrupt (and has an object with the wrong SHA1 - that's what 
> > the testsuite checks for), then it's probably good to get the valid object 
> > from the remote..
> 
> I agree with that reasoning.
For the record, I don't agree.  I stated why in my other email.
> We did not do paranoid in git-pull long after we introduced the .keep 
> thing anyway,
That doesn't make it more "correct".
> so I do not
> think the following patch is even needed, but I am throwing it
> out just for discussion.
1) None of the objects in a pack should exist in the local repo when 
   fetching, meaning that the paranoia code should not be executed 
   normally.
2) Running index-pack on a pack _inside_ a repository is a dubious thing 
   to do with questionable usefulness already.
3) It is unefficient to run pack-objects with --stdout just to feed the 
   result to index-pack afterwards while repack-objects can create the 
   index itself, which is the source of this discussion.
   
4) I invite you to read the commit log for 8685da42561 where the 
   _perception_ of GIT's security is discussed which led to the paranoia 
   check, and sometimes the perception is more valuable than the 
   reality, especially when it is free.

Therefore Linus' patch and this one are working around the wrong issue as described in (3) IMHO.

What could be done instead, if really really needed, is to have the paranoia test be made conditional on index-pack --stdin instead. But please no bogus extra switches pretty please.

Nicolas
Previous: Junio C Hamano
Message 58 of 58 in “git-index-pack really does suck..”
  1. Linus TorvaldsApr 3, 2007
  2. Linus TorvaldsApr 3, 2007
  3. Nicolas PitreApr 3, 2007
  4. Nicolas PitreApr 3, 2007
  5. Chris LeeApr 3, 2007
  6. Nicolas PitreApr 3, 2007
  7. Chris LeeApr 3, 2007
  8. Linus TorvaldsApr 3, 2007
  9. Nicolas PitreApr 3, 2007
  10. Junio C HamanoApr 3, 2007
  11. Linus TorvaldsApr 3, 2007
  12. Nicolas PitreApr 3, 2007
  13. Chris LeeApr 3, 2007
  14. Linus TorvaldsApr 3, 2007
  15. Linus TorvaldsApr 3, 2007
  16. Shawn O. PearceApr 3, 2007
  17. Linus TorvaldsApr 3, 2007
  18. Shawn O. PearceApr 3, 2007
  19. Linus TorvaldsApr 3, 2007
  20. Linus TorvaldsApr 3, 2007
  21. Junio C HamanoApr 3, 2007
  22. Shawn O. PearceApr 3, 2007
  23. Junio C HamanoApr 3, 2007
  24. 1/2 git-fetch--tool pick-rrefJunio C Hamano, Apr 5, 2007
  25. 2/2 git-fetch: use fetch--tool pick-rref to avoid local fetch from alternateJunio C Hamano, Apr 5, 2007
  26. Shawn O. PearceApr 5, 2007
  27. Junio C HamanoApr 5, 2007
  28. Nicolas PitreApr 3, 2007
  29. Shawn O. PearceApr 3, 2007
  30. Junio C HamanoApr 3, 2007
  31. Shawn O. PearceApr 3, 2007
  32. Jeff KingApr 3, 2007
  33. Dana HowApr 3, 2007
  34. Linus TorvaldsApr 3, 2007
  35. David LangApr 3, 2007
  36. Nicolas PitreApr 3, 2007
  37. Nicolas PitreApr 3, 2007
  38. Linus TorvaldsApr 3, 2007
  39. Nicolas PitreApr 3, 2007
  40. Shawn O. PearceApr 3, 2007
  41. Linus TorvaldsApr 3, 2007
  42. Nicolas PitreApr 3, 2007
  43. Junio C HamanoApr 3, 2007
  44. Shawn O. PearceApr 3, 2007
  45. Nicolas PitreApr 3, 2007
  46. Linus TorvaldsApr 3, 2007
  47. Nicolas PitreApr 3, 2007
  48. David LangApr 3, 2007
  49. Alex RiesenApr 4, 2007
  50. David LangApr 6, 2007
  51. Junio C HamanoApr 6, 2007
  52. Junio C HamanoApr 6, 2007
  53. David LangApr 6, 2007
  54. Junio C HamanoApr 6, 2007
  55. David LangApr 6, 2007
  56. Linus TorvaldsApr 3, 2007
  57. Junio C HamanoApr 3, 2007
  58. Nicolas PitreApr 3, 2007

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.