]> git.ipfire.org Git - thirdparty/git.git/commit
midx: introduce `--no-write-chain-file` for incremental MIDX writes
authorTaylor Blau <me@ttaylorr.com>
Tue, 19 May 2026 15:57:51 +0000 (11:57 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:31:13 +0000 (11:31 +0900)
commit8d342ed4b5dfbaa16f8bbc4537907d1e1224358e
tree6a1d3b0d6e0ec0742326b61841dcf281fdd51071
parent046a8686a406ebff7ca01dd4a3fabf9a679e010f
midx: introduce `--no-write-chain-file` for incremental MIDX writes

When writing an incremental MIDX layer, the MIDX machinery writes the
new layer into the multi-pack-index.d directory and then updates the
multi-pack-index-chain file to include the freshly written layer.

Future callers however may not wish to immediately update the MIDX chain
itself, preferring instead to write out new layer(s) themselves before
atomically updating the chain. Concretely, the new incremental
MIDX-based repacking strategy will want to do exactly this (that is,
assemble the new MIDX chain itself before writing a new chain file and
atomically linking it into place).

Introduce a `--no-write-chain-file` flag that:

 * writes the new MIDX layer into the multi-pack-index.d directory

 * prints its checksum

 * does not update the multi-pack-index-chain file.

The MIDX chain file (and thus, the lock protecting it) remain untouched,
allowing callers to assemble the chain themselves. This flag requires
`--incremental`, since the notion of a separate layer only makes sense
for incremental MIDXs.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-multi-pack-index.adoc
builtin/multi-pack-index.c
midx-write.c
midx.h
t/t5334-incremental-multi-pack-index.sh
t/t5335-compact-multi-pack-index.sh