Subject: [PATCH 0/8] midx-write: miscellaneous clean-ups for incremental MIDXs

From: Taylor Blau <[email-masked]>
Date: Thu, 23 May 2024 12:37:59 -0400

This series has a grab-bag of midx-write related cleanups that I pulled
out of a larger series to implement incremental MIDX chains.

The main goal of this series is to support reading an existing MIDX when
writing a new one with `--stdin-packs`, since we need this capability
for incremental MIDXs. Along the way there are a few other
quality-of-life improvements and refactorings. The first patch in this
series fixes an existing segfault that can be triggered on released
versions of Git (but has no interesting security implications).

Admittedly, this series isn't all that interesting on its own, but it
does chip away at the larger series, so it should be easier to review.
Hopefully sending this one separately is OK, and in either event, thank
you in advance for your review!

Taylor Blau (8):
  midx-write.c: tolerate `--preferred-pack` without bitmaps
  midx-write.c: reduce argument count for `get_sorted_entries()`
  midx-write.c: pass `start_pack` to `get_sorted_entries()`
  midx-write.c: extract `should_include_pack()`
  midx-write.c: extract `fill_packs_from_midx()`
  midx-write.c: support reading an existing MIDX with `packs_to_include`
  midx: replace `get_midx_rev_filename()` with a generic helper
  pack-bitmap.c: reimplement `midx_bitmap_filename()` with helper

 midx-write.c                | 157 ++++++++++++++++++------------------
 midx.c                      |  14 ++--
 midx.h                      |   6 +-
 pack-bitmap.c               |   5 +-
 pack-revindex.c             |   3 +-
 t/t5319-multi-pack-index.sh |  23 ++++++
 6 files changed, 118 insertions(+), 90 deletions(-)

base-commit: 4365c6fcf96caac73dcc412aa25db34cf8df48d5
-- 
2.45.1.217.g9bb58e2bf5a.dirty