]> git.ipfire.org Git - thirdparty/git.git/commit
repack: teach MIDX retention about geometric rollups
authorTaylor Blau <me@ttaylorr.com>
Fri, 26 Jun 2026 19:02:23 +0000 (15:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jun 2026 21:54:54 +0000 (14:54 -0700)
commit5ff781e9fa3cfea4ac008c7e0e06a5f720b78060
tree86d9a970eedce4cee1766b884b1ec6de5c38f903
parent3e38d04bd41791c8f50e008adb5cb09f876d4edf
repack: teach MIDX retention about geometric rollups

When writing an incremental MIDX, existing_packs_retain_midx_packs()
marks packs in the existing MIDX chain as retained. This keeps them from
being deleted by the later existing_packs deletion pass, since retained
MIDX layers may still refer to those packs.

Geometric repacks need a narrower rule. Packs below the split are rolled
up into the newly-written pack, and should remain eligible for deletion
even if the old MIDX chain mentions them. Packs above the split were
marked as retained by the previous commit.

Teach existing_packs_retain_midx_packs() to skip packs which are part of
the geometric rollup. This does not change the current caller's behavior,
since geometric repacks do not yet use the existing_packs deletion path.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c
repack.c
repack.h