aboutsummaryrefslogtreecommitdiff
path: root/midx-write.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2026-02-24 14:00:45 -0500
committerJunio C Hamano <gitster@pobox.com>2026-02-24 11:16:35 -0800
commitd54da84bd9de09fc339accff553f1fc8a5539154 (patch)
treedb24f30d2c4c9b0a2fffe29c1b9f63351795fc43 /midx-write.c
parent9df44a97f165bbdd8d591c6e99c8894ae036b5bd (diff)
downloadgit-d54da84bd9de09fc339accff553f1fc8a5539154.tar.xz
midx: enable reachability bitmaps during MIDX compaction
Enable callers to generate reachability bitmaps when performing MIDX layer compaction by combining all existing bitmaps from the compacted layers. Note that because of the object/pack ordering described by the previous commit, the pseudo-pack order for the compacted MIDX is the same as concatenating the individual pseudo-pack orderings for each layer in the compaction range. As a result, the only non-test or documentation change necessary is to treat all objects as non-preferred during compaction so as not to disturb the object ordering. In the future, we may want to adjust which commit(s) receive reachability bitmaps when compacting multiple .bitmap files into one, or even generate new bitmaps (e.g., if the references have moved significantly since the .bitmap was generated). This commit only implements combining all existing bitmaps in range together in order to demonstrate and lay the groundwork for more exotic strategies. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx-write.c')
-rw-r--r--midx-write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/midx-write.c b/midx-write.c
index bf53ad1c4b..0ff2e45aa7 100644
--- a/midx-write.c
+++ b/midx-write.c
@@ -676,7 +676,7 @@ static uint32_t *midx_pack_order(struct write_midx_context *ctx)
struct pack_midx_entry *e = &ctx->entries[i];
data[i].nr = i;
data[i].pack = midx_pack_perm(ctx, e->pack_int_id);
- if (!e->preferred)
+ if (!e->preferred || ctx->compact)
data[i].pack |= (1U << 31);
data[i].offset = e->offset;
}