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

Re: [RFC PATCH] index-pack: optionally allow duplicate objects

From
Taylor Blau <ttaylorr@openai.com>
Date
Jul 29, 2026, 21:29 UTC
Message-ID
<ampwoImYYKeYzkw7@com-79390>
In-Reply-To
<20260729211716.40166-1-friel@openai.com>
On Wed, Jul 29, 2026 at 02:17:16PM -0700, friel@openai.com wrote:
Show 14 quoted lines
> From: Friel <friel@openai.com>
>
> On Wed, Jul 29, 2026 at 01:32:39PM -0700, Junio C Hamano wrote:
>
> > I can live with such an extension as long as we teach the receiving
> > end to deduplicate the extra copy.
>
> That makes sense. We don't want packs containing duplicate objects to
> become a persistent source of duplicate objects in other repositories.
>
> For our server, duplicate objects would be an exceptional consequence of
> an optimization, not normal operation. We have not seen duplicates in
> practice yet. But preventing them imposes a cost on every upload-pack
> request even when duplicates are rare.

To Junio's point about "these cannot go forever unchecked", I agree, and I think this is an important internal detail which I may not have made clear. We don't expect to send packs containing duplicate objects as a general case, but this patch and my series are a defensive measure to make sure clients don't immediately choke on them.

Show 5 quoted lines
> I'll talk with Taylor about whether the client should repack when it
> detects duplicates, or whether Git already has a way to mark such a pack
> as dirty for reuse or retransmission until it has been cleaned up.
> The intent would be to pay that cost only when duplicates actually
> occur.

Let me think a little bit more about this. It would be a shame to have to repack the entirety of the pack when there are only a few (or zero) duplicate object entries. But if we can efficiently pluck them out of the stream when fetching/cloning, that may be worthwhile.

FWIW, (and I'm biased, but) I still think the series this patch is based on is worth picking up. I think it makes sense to have better support when we *do* happen to see duplicate objects (e.g., to recover the only good copy of some object you have, similar to Peff's argument quoted earlier in the thread).

But "better support" can coexist with "...you still shouldn't do this".
> In all humility, thank you for reviewing and considering the RFC PATCH.
> I'm still getting acquainted with mailing list and the history of Git,
> and I'm happy to have Taylor & Ted's help.
Thanks for saying that. Welcome to the list :-).

Thanks, Taylor

Previous: friel@openai.comNext: Taylor Blau
Message 7 of 8 in “index-pack: optionally allow duplicate objects”
  1. index-pack: optionally allow duplicate objectsfriel@openai.com, Jul 28, 2026
  2. Taylor BlauJul 28, 2026
  3. Junio C HamanoJul 29, 2026
  4. Taylor BlauJul 29, 2026
  5. Junio C HamanoJul 29, 2026
  6. friel@openai.comJul 29, 2026
  7. Taylor BlauJul 29, 2026
  8. Taylor BlauJul 29, 2026

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.