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

Re: [PATCH 2/2] t5608: assert that the packs involved really are that large

From
Kristofer Karlsson <krka@spotify.com>
Date
Nov 6, 2026, 15:12 UTC
Message-ID
<CAL71e4PmJ1an8jwJNRGmU9w_HAM7WHC0Xk3rMKqQFxB_KNTA0g@mail.gmail.com>
In-Reply-To
<au3qKLWlM45rByWg@pks.im>
On Fri, 6 Nov 2026 at 15:54, Patrick Steinhardt <ps@pks.im> wrote:
Show 9 quoted lines
>
> > 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.

Show 5 quoted lines
> > +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.

Show 6 quoted lines
> > +     # 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

Previous: Patrick Steinhardt
Message 5 of 5 in “t5608: assert that the packs involved really are that large”
  1. 0/2 t5608: assert that the packs involved really are that largeKristofer Karlsson via GitGitGadget, Nov 6, 2026
  2. 1/2 unpack-objects: pass the size of a streamed blob as size_tKristofer Karlsson via GitGitGadget, Nov 6, 2026
  3. 2/2 t5608: assert that the packs involved really are that largeKristofer Karlsson via GitGitGadget, Nov 6, 2026
  4. Patrick SteinhardtNov 6, 2026
  5. Kristofer KarlssonNov 6, 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.