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

Re: [BUG] commit walk machinery is dangerous !

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 14, 2008, 21:55 UTC
Message-ID
<7vbq10f7wr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.10.0807141641110.12484@xanadu.home>
Nicolas Pitre <nico@cam.org> writes:
Show 7 quoted lines
> However this time a corruption turned up and exposed what I think is a 
> major flaw in git's error checking.  To demonstrate it, I created the 
> following test case.  Turning the error() into a die() on line 772 of 
> commit.c makes this test pass but I don't know if this is the 
> appropriate fix (e.g. some attempt to parse non existing commits could 
> be valid usage, etc.).  Note this is critical only for git versions 
> later than commit 8eca0b47ff15.

Which probably means we should revert that commit as faulty? IIRC, before that commit we did check and error out correctly but you loosened the check to introduce "a major flaw" with that commit.

$ for b in maint master next pu
  do
      echo -n $b; git cat-file blob $b:commit.c | wc -l
  done
maint 672
master 672
next 779
pu 789
Hmph...
Previous: Nicolas PitreNext: Nicolas Pitre
Message 2 of 9 in “[BUG] commit walk machinery is dangerous !”
  1. Nicolas PitreJul 14, 2008
  2. Junio C HamanoJul 14, 2008
  3. Nicolas PitreJul 14, 2008
  4. Junio C HamanoJul 14, 2008
  5. Nicolas PitreJul 14, 2008
  6. 1/2 restore legacy behavior for read_sha1_file()Nicolas Pitre, Jul 15, 2008
  7. 2/2 test case for previous commitNicolas Pitre, Jul 15, 2008
  8. Nicolas PitreJul 15, 2008
  9. unpack_entry (was: [BUG] commit walk machinery is dangerous !)Shawn O. Pearce, Jul 15, 2008

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.