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

Previously, `--write-midx=incremental` required `--geometric` and would
die() without it. Relax this restriction so that incremental MIDX
repacking can be used independently.

Without `--geometric`, the behavior is append-only: a single new MIDX
layer is created containing whatever packs were written by the repack
and appended to the existing chain (or a new chain is started). Existing
layers are preserved as-is with no compaction or merging.

Implement this via a new repack_make_midx_append_plan() that builds a
plan consisting of a WRITE step for the freshly written packs followed
by COPY steps for every existing MIDX layer. The existing compaction
plan (repack_make_midx_compaction_plan) is used only when `--geometric`
is active.

Update the documentation to describe the behavior with and without
`--geometric`, and replace the test that enforced the old restriction
with one exercising append-only incremental MIDX repacking.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-repack.adoc
builtin/repack.c
repack-midx.c
t/t7705-repack-incremental-midx.sh