git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:08 UTC

Re: [PATCH v2 8/8] repack: include required packs in incremental MIDX writes

From
Jeff King <peff@peff.net>
Date
Oct 2, 2026, 23:41 UTC
Message-ID
<20261002234157.GF834759@coredump.intra.peff.net>
In-Reply-To
<a42f775cbe27b385bfc8ff38f33604b3913dc340.1790827875.git.me@ttaylorr.com>
On Wed, Sep 30, 2026 at 11:12:05PM -0500, Taylor Blau wrote:
Show 11 quoted lines
> The geometric plan from 1da62fb5c86 (repack: implement incremental MIDX
> repacking, 2026-05-19) can omit kept and cruft packs, since neither
> necessarily participates in the geometric repack. Such packs can also be
> lost when replacing a tip layer that contains them. Neither plan
> consults `midx_included_packs()`, so the rules for retaining cruft in
> ordinary MIDX writes do not protect incremental writes.
> 
> Use that selection logic to add missing packs to each plan's write step.
> Skip packs in retained base layers, but include required packs from a
> replaced tip. Count added objects when choosing which layers to compact,
> without changing the preferred pack.

I admit I had a hard time following this patch. I think the point is that we're going to include some packs in the midx that were not covered previously. But it was hard to see where that happens. I think the magic bit is this:

Show 5 quoted lines
> @@ -557,17 +604,20 @@ static void repack_make_midx_append_plan(struct repack_write_midx_opts *opts,
>  					 size_t *steps_nr_p)
> [..]
> -	for (i = 0; i < opts->names->nr; i++) {
> +	midx_included_packs(&include, opts, m);
where we rely on midx_included_packs() to do that selection.

So I _think_ this is doing the right thing, but my confidence in my review is kind of low. To some degree I'd just rely on the functional tests here.

-Peff
Previous: Jeff KingNext: Taylor Blau
Message 35 of 41 in “repack: various corner cases for cruft-less MIDXs”
  1. 0/4 repack: various corner cases for cruft-less MIDXsTaylor Blau, Sep 30, 2026
  2. 1/4 pack-objects: introduce `stdin_packs_context` structTaylor Blau, Sep 30, 2026
  3. 2/4 pack-objects: ensure tree/tag closure with '--stdin-packs=follow'Taylor Blau, Sep 30, 2026
  4. 3/4 repack: retain cruft packs in MIDXs after incremental repacksTaylor Blau, Sep 30, 2026
  5. 4/4 repack: retain cruft packs in MIDXs containing kept packsTaylor Blau, Sep 30, 2026
  6. Junio C HamanoSep 30, 2026
  7. Junio C HamanoSep 30, 2026
  8. Derrick StoleeSep 30, 2026
  9. Jeff KingSep 30, 2026
  10. Jeff KingSep 30, 2026
  11. Jeff KingSep 30, 2026
  12. Jeff KingSep 30, 2026
  13. Taylor BlauOct 1, 2026
  14. Taylor BlauOct 1, 2026
  15. Taylor BlauOct 1, 2026
  16. Taylor BlauOct 1, 2026
  17. Taylor BlauOct 1, 2026
  18. Taylor BlauOct 1, 2026
  19. 0/8 repack: various corner cases for cruft-less MIDXsTaylor Blau, Oct 1, 2026
  20. 1/8 pack-objects: introduce `stdin_packs_context` structTaylor Blau, Oct 1, 2026
  21. 2/8 pack-objects: ensure tree/tag closure with '--stdin-packs=follow'Taylor Blau, Oct 1, 2026
  22. 3/8 repack: retain cruft packs in MIDXs after incremental repacksTaylor Blau, Oct 1, 2026
  23. 4/8 repack: use a sorted list for explicitly kept packsTaylor Blau, Oct 1, 2026
  24. 5/8 repack: follow kept packs when omitting cruft from the MIDXTaylor Blau, Oct 1, 2026
  25. 6/8 repack: track the preferred pack explicitly in MIDX write stepsTaylor Blau, Oct 1, 2026
  26. 7/8 repack: defer allocating the append plan's write stepTaylor Blau, Oct 1, 2026
  27. 8/8 repack: include required packs in incremental MIDX writesTaylor Blau, Oct 1, 2026
  28. Elijah NewrenOct 1, 2026
  29. Taylor BlauOct 2, 2026
  30. Jeff KingOct 2, 2026
  31. Jeff KingOct 2, 2026
  32. Jeff KingOct 2, 2026
  33. Jeff KingOct 2, 2026
  34. Jeff KingOct 2, 2026
  35. Jeff KingOct 2, 2026
  36. Taylor BlauOct 3, 2026
  37. Taylor BlauOct 3, 2026
  38. Taylor BlauOct 3, 2026
  39. Taylor BlauOct 3, 2026
  40. Jeff KingOct 3, 2026
  41. Jeff KingOct 3, 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.