Subject: Re: [PATCH 3/2] t5309: mark delta-cycle failover tests as passing

From: Junio C Hamano <[email-masked]>
Date: Tue, 02 Sep 2014 10:19:37 -0700

Jeff King <[email-masked]> writes:

> We used to do that because the only way to correctly resolve them was by
> introducing a duplicate base object, and we did not allow that. Patch 2
> from my series loosened this, which makes index-pack work, but not
> necessarily the rest of git. And since index-pack is the gatekeeper on
> receiving objects from remotes, it needs to be the _most_ picky. So my
> series is definitely a regression as-is.

Yeah, at first, allowing the delta resolution so that we can
resurrect data from such a corrupt pack looked a no-brainer
improvement, but I think that is probably a right conclusion.
Thanks for digging this one through.

>      I wonder if index-pack is really the right place for such a "please
>      help me get the data out of this broken pack" operation in the
>      first place. If it is a broken pack, we are probably much better
>      off to explode it into loose objects than try to index a broken
>      pack. That's way less efficient, but this should be a last-resort.

Most objects in such a broken pack do not have to get unpacked, no?
I wonder if we can excise duplicate objects from the pack stream,
which would involve adjusting the delta offset for any ofs-delta
representations that appear after the part we cut out of the stream
to remove such cruft.