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

Re: [PATCHv5] sha1_file: fix iterating loose alternate objects

From
Jeff King <peff@peff.net>
Date
Feb 2, 2015, 20:27 UTC
Message-ID
<20150202202733.GB28915@peff.net>
In-Reply-To
<E05CAD49-755C-4F26-A527-597B1AD412D8@jonathonmah.com>
On Mon, Feb 02, 2015 at 12:05:54PM -0800, Jonathon Mah wrote:
> Simplified test per Junio (verified that it fails before and passes
> now). Punting on Jeff's "more elaborate example".

I think that's fine. I started to try to create such an example, but it's actually rather tricky. If the alternate has the tip object, then one of these must be true:

  1. It has all of the objects the tip depends on.
  2. It is missing an object, and this tip is part of the referenced
     history.
  3. It is missing an object, but this part of history is not
     referenced.

In case (1), we do not care about deleting objects from the base repository; we already have another copy in the alternate.

In case (2), the alternate is corrupt, and all bets are off.

In case (3), we can only have dropped the object from the alternate by pruning it and keeping the tip object that refers to it. Which is the exact thing that this new code was added to avoid (to always keep depended-upon objects).

So I actually do not see how the situation would come up in practice, and possibly we could drop the iteration of the alternates' loose objects entirely from this code. But certainly that is orthogonal to Jonathon's fix (which is a true regression for the less-exotic case that his test demonstrates).

-Peff
Previous: Jonathon MahNext: Junio C Hamano
Message 2 of 4 in “[PATCHv5] sha1_file: fix iterating loose alternate objects”
  1. Jonathon MahFeb 2, 2015
  2. Jeff KingFeb 2, 2015
  3. Junio C HamanoFeb 2, 2015
  4. Jeff KingFeb 2, 2015

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.