Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <ttaylorr@openai.com>
Cc: friel@openai.com,  git@vger.kernel.org,  peff@peff.net,
	stolee@gmail.com,  me@ttaylorr.com,  ps@pks.im,
	jonathantanmy@fastmail.com
Subject: Re: [RFC PATCH] index-pack: optionally allow duplicate objects
Date: Wed, 29 Jul 2026 13:32:39 -0700	[thread overview]
Message-ID: <xmqqtspho7tk.fsf@gitster.g> (raw)
In-Reply-To: <ampR7FkErK3CQPyC@com-79390> (Taylor Blau's message of "Wed, 29 Jul 2026 14:18:04 -0500")

Taylor Blau <ttaylorr@openai.com> writes:

> If we can find useful ways to combine the ideas above with Git's in-tree
> implementation of upload-pack, one could imagine that Git itself may
> eventually send packs containing duplicate copies of some object(s)
> behind a capability. In other words, for clients that know how to
> process such a pack, the server may wish to ask the client to do just
> that in the name of saving some CPU cycles necessary to generate a pack
> that doesn't have any duplicate objects.

I can live with such an extension as long as we teach the receiving
end to deduplicate the extra copy.  Leaving packs with duplicate
objects on disk is a completely different story, as it will become a
source of spreading such broken packs elsewhere, though.

> But I would note that having packs containing duplicate objects is not a
> new repository state for Git. Non-strict `index-pack` accepts duplicate
> entries today, and shallow and filtered clones can store the same pack.

The same as what???

> My series in 'tb/pack-with-duplicates' attempts to fix the known-broken
> assumptions in reverse indexes, delta resolution, MIDX verification, and
> bitmap reuse because those packs can already exist.
>
> If duplicate entries are to be forbidden entirely in order for a pack to
> be considered valid, then I think we should reject them in every
> `index-pack` mode, including the shallow and filtered clone paths, and
> diagnose existing packs in `fsck`.

Yup, I think that would be a sensible longer-term direction.  We may
need a bit more tool support to "fix" by reindexing at the receiving
end, though.  As you say, "cancatenate two packs, damn the duplicates"
may be a cheap way for server side to give union of objects contained
in these two packs, but doing so without even measuring how much they
are duplicating cannot go on forever unchecked.  Somebody needs to
remove these duplicates, and the time the downloader indexes the
incoming pack would be the best place to do so.  It needs to read
each and every object in the pack stream to make the .idx file out
of the stream anyway.

  reply	other threads:[~2026-07-29 20:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  4:25 [RFC PATCH] index-pack: optionally allow duplicate objects friel
2026-07-28 23:29 ` Taylor Blau
2026-07-29  1:41 ` Junio C Hamano
2026-07-29 19:18   ` Taylor Blau
2026-07-29 20:32     ` Junio C Hamano [this message]
2026-07-29 21:17       ` friel
2026-07-29 21:29         ` Taylor Blau
2026-07-29 21:23       ` Taylor Blau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqtspho7tk.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=friel@openai.com \
    --cc=git@vger.kernel.org \
    --cc=jonathantanmy@fastmail.com \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    --cc=stolee@gmail.com \
    --cc=ttaylorr@openai.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox