From: Kristofer Karlsson Date: Fri, 06 Nov 2026 15:12:38 GMT Subject: Re: [PATCH 2/2] t5608: assert that the packs involved really are that large Message-ID: In-Reply-To: On Fri, 6 Nov 2026 at 15:54, Patrick Steinhardt wrote: > > > The ">4GB object" tests added in 4b220cafbe (t5608: add regression > > test for >4GB object clone, 2026-05-08) have a similar problem. They > > are meant to cover a fix in both index-pack and unpack-objects, but > > "git clone" always keeps the received pack, so setting > > fetch.unpackLimit in the unpack-objects variant has no effect, and > > both tests use index-pack. > > So this test in particular never exercised what it was designed to? Yes, I think that's the case (though I could be wrong about it). In any case, I think regardless of if it was broken from the start or not, it makes sense to ensure it can't be silently broken by any other future optimization that shrinks the pack file sizes. > And the preceding patch fixes a third assertion that we'd otherwise have > seen fail here, I assume? Exactly, I would have preferred to just send the test improvement but it turned out that fixing the problem was easier than making the test more flexible, so I added that as a prerequisite patch. > > +test_expect_success 'setup produces a pack larger than 2GB' ' > > + test_has_pack_larger_than 2gb-repo/.git/objects/pack $size_2gb > > +' > > Nit, not worth a reroll: I would have folded this into the test itself. I did consider that, but figured this was not too much overhead, and made it slightly easier to read. That said, if I need to reroll for other reasons, I can definitely inline it into the setup instead. > > + # fetch-pack on the unpack-objects path. This needs "fetch", as > > + # "clone" always keeps the received pack. > > This is a bit of a surprise to me, I thought that it would apply to both > git-clone(1) and git-fetch(1). Did you by any chance check whether this > is intentional or whteher it's another bug? It appears to be intentional (and old). In the commit ad89721508 (fetch-pack: -k option to keep downloaded pack., 2005-12-14) says: We earlier had something like that on clone-pack side once, but the list discussion resulted in the decision that it makes sense to always keep the pack for clone-pack, so unpacking option is not enabled on the clone-pack side, [...] and the builtin clone kept that behaviour by always setting TRANS_OPT_KEEP, since 8434c2f1af (Build in clone, 2008-04-27). So the unpack limits have only ever applied to fetch. > Other than that this looks good to me, thanks. > > Patrick Thanks for the review! Kristofer