]> git.ipfire.org Git - thirdparty/git.git/commit
repack: introduce `--write-midx=incremental`
authorTaylor Blau <me@ttaylorr.com>
Tue, 19 May 2026 15:58:22 +0000 (11:58 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:31:14 +0000 (11:31 +0900)
commit938af8926099882ff87f8ffa4115c34ed63d9e8b
tree74ebe73dd559760f29846e8827c96ef383db7217
parent1da62fb5c868447640c3697e9f2ec0004e24951f
repack: introduce `--write-midx=incremental`

Expose the incremental MIDX repacking mode (implemented in an earlier
commit) via a new --write-midx=incremental option for `git repack`.

Add "incremental" as a recognized argument to the --write-midx
OPT_CALLBACK, mapping it to REPACK_WRITE_MIDX_INCREMENTAL. When this
mode is active and --geometric is in use, set the midx_layer_threshold
on the pack geometry so that only packs in sufficiently large tip layers
are considered for repacking.

Two new configuration options control the compaction behavior:

 - repack.midxSplitFactor (default: 2): the factor used in the
   geometric merging condition for MIDX layers.

 - repack.midxNewLayerThreshold (default: 8): the minimum number of
   packs in the tip MIDX layer before its packs are considered as
   candidates for geometric repacking.

Add tests exercising the new mode across a variety of scenarios
including basic geometric violations, multi-round chain integrity,
branching and merging histories, cross-layer object uniqueness, and
threshold-based compaction.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/repack.adoc
Documentation/git-repack.adoc
builtin/repack.c
midx.c
midx.h
repack-geometry.c
repack-midx.c
repack.c
repack.h
t/meson.build
t/t7705-repack-incremental-midx.sh [new file with mode: 0755]