]> git.ipfire.org Git - thirdparty/git.git/commit
repack: mark geometric progression of packs as retained
authorTaylor Blau <me@ttaylorr.com>
Fri, 26 Jun 2026 19:02:20 +0000 (15:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Jun 2026 21:54:54 +0000 (14:54 -0700)
commit3e38d04bd41791c8f50e008adb5cb09f876d4edf
tree714183cf201df60c6278ba2e54e03bf607e7cb60
parentd65798abb799bdf6915501ca274fc85cbc35d69f
repack: mark geometric progression of packs as retained

In non-geometric repacks, any packs which repack wishes to delete are
handled via the `existing_packs` struct, which has a mechanism to retain
would-be-deleted packs (e.g., if we happened to write a new pack
identical to one otherwise marked for deletion).

In geometric repacks, repack removes any rewritten packs (alternatively,
any packs which were combined in order to restore a geometric
progression) by enumerating them via `pack_geometry_remove_redundant()`.

Prepare to use the `existing_packs` deletion machinery for geometric
repacks by marking any non-kept packs above the geometric split line as
retained. Do the same for promisor packs, which have their own split
point.

This commit only records which packs the later deletion pass must keep;
it does not change which packs are written or removed.

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