]> git.ipfire.org Git - thirdparty/git.git/commit
midx: implement writing incremental MIDX bitmaps
authorTaylor Blau <me@ttaylorr.com>
Thu, 20 Mar 2025 17:57:08 +0000 (13:57 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Mar 2025 11:34:16 +0000 (04:34 -0700)
commit27afc272c49137460fe9e58e1fcbe4c1d377b304
treedb4f863f18b4829d32a858c3e7cd445734ec577c
parent5999b44fcbe1e1638960314c65723c60be6aeb9c
midx: implement writing incremental MIDX bitmaps

Now that the pack-bitmap machinery has learned how to read and interact
with an incremental MIDX bitmap, teach the pack-bitmap-write.c machinery
(and relevant callers from within the MIDX machinery) to write such
bitmaps.

The details for doing so are mostly straightforward. The main changes
are as follows:

  - find_object_pos() now makes use of an extra MIDX parameter which is
    used to locate the bit positions of objects which are from previous
    layers (and thus do not exist in the current layer's pack_order
    field).

    (Note also that the pack_order field is moved into struct
    write_midx_context to further simplify the callers for
    write_midx_bitmap()).

  - bitmap_writer_build_type_index() first determines how many objects
    precede the current bitmap layer and offsets the bits it sets in
    each respective type-level bitmap by that amount so they can be OR'd
    together.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
midx-write.c
pack-bitmap-write.c
pack-bitmap.h
t/t5334-incremental-multi-pack-index.sh