Re: [PATCH v3 06/13] pack-bitmap.c: support bitmap pack-reuse with incremental MIDXs
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 28, 2025, 10:01 UTC
- Message-ID
- <Z8GJc6iDqueVgc67@pks.im>
- In-Reply-To
- <c8401fa0fbdbf1fe1422cb3105aab2cb8058f331.1732054032.git.me@ttaylorr.com>
On Tue, Nov 19, 2024 at 05:07:35PM -0500, Taylor Blau wrote:
Show 19 quoted lines
> diff --git a/pack-bitmap.c b/pack-bitmap.c
> index c2c824347a6..1dddb242434 100644
> --- a/pack-bitmap.c
> +++ b/pack-bitmap.c
> @@ -2347,14 +2348,18 @@ void reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
> uint32_t pack_int_id;
>
> if (bitmap_is_midx(bitmap_git)) {
> + struct multi_pack_index *m = bitmap_git->midx;
> uint32_t preferred_pack_pos;
>
> - if (midx_preferred_pack(bitmap_git->midx, &preferred_pack_pos) < 0) {
> + while (m->base_midx)
> + m = m->base_midx;
> +
> + if (midx_preferred_pack(m, &preferred_pack_pos) < 0) {
> warning(_("unable to compute preferred pack, disabling pack-reuse"));
> return;
> }Instead of completely disabling preferred packs, should we maybe fall back to the preferred pack of the next-higher layer?
Patrick