[PATCH 0/4] repack: various corner cases for cruft-less MIDXs
- From
Taylor Blau <ttaylorr@openai.com>
- Date
- Sep 30, 2026, 01:28 UTC
- Message-ID
- <cover.1790731662.git.me@ttaylorr.com>
This patch series fixes a few bugs I spotted while investigating the cruft-less MIDX feature.
The bugs addressed are found in various corner cases, and, when triggered, may result in a MIDX being written whose objects are not closed under reachability. When this happens while the caller is trying to write reachability bitmaps, bitmap generation may fail if one or more selected commits are descendants of the open portion of the MIDX.
The series is structured as follows:
* The first patch is a preparatory refactoring to add a context struct within pack-objects' handling of '--stdin-packs' to minimize the diff in the subsequent patch.
* The second patch fixes a case where once-cruft tree and annotated tag objects may prevent reachability closure when objects reachable from them are not present in the input pack(s).
* The third patch fixes a case where incremental repack operations may introduce the same bug when the pack generated by an incremental repack does not pack an additional copy of once-cruft object(s).
* The fourth and final patch addresses a similar case involving .keep packs.
Thanks in advance for reviewing!
Taylor Blau (4): pack-objects: introduce `stdin_packs_context` struct pack-objects: ensure tree/tag closure with '--stdin-packs=follow' repack: retain cruft packs in MIDXs after incremental repacks repack: retain cruft packs in MIDXs containing kept packs
Documentation/git-pack-objects.adoc | 2 + builtin/pack-objects.c | 73 ++++++++++++++++++++------ builtin/repack.c | 6 +++ repack-midx.c | 5 ++ t/t5331-pack-objects-stdin.sh | 81 +++++++++++++++++++++++++++++ t/t7704-repack-cruft.sh | 51 ++++++++++++++++++ 6 files changed, 202 insertions(+), 16 deletions(-)
base-commit: a018953688f1b10bddf91bff8747068f5f4746a4
-- 2.56.0.4.gbee41d2fc68