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

Re: [BUG] commit walk machinery is dangerous !

From
Nicolas Pitre <nico@cam.org>
Date
Jul 14, 2008, 23:39 UTC
Message-ID
<alpine.LFD.1.10.0807141937180.12484@xanadu.home>
In-Reply-To
<7vod50dote.fsf@gitster.siamese.dyndns.org>
On Mon, 14 Jul 2008, Junio C Hamano wrote:
Show 18 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
> > It is those with semantic meaning (e.g. object doesn't exist) which 
> > should be audited, especially if used in the context of repository 
> > modification, which pretty much limits it to the test case I produced.
> 
> I've been wondering if we should make the change 8eca0b4 (implement some
> resilience against pack corruptions, 2008-06-23) less aggressive.
> 
> It makes loose objects and data from other packs to be used as fallback
> where we used to just punt, which is a genuine improvement for "salvaging"
> mode of operation, but at the same time, it now forbids the callers to
> expect that the objects they learned to exist from has_sha1_file() or
> nth_packed_object_sha1() should never result NULL return value from
> read_sha1_file().
> 
> It may make it safe again to fail if you cannot salvage using fallback
> method after all.  Something like the attached.

Well, I have a different solution which should restore the original "behavior" in the presence of existing but non-readable objects. Patch will follow later.

Nicolas
Previous: Junio C HamanoNext: Nicolas Pitre
Message 5 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.