]> git.ipfire.org Git - thirdparty/git.git/commit
pseudo-merge: scaffolding for reads
authorTaylor Blau <me@ttaylorr.com>
Thu, 23 May 2024 21:26:52 +0000 (17:26 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 24 May 2024 18:40:43 +0000 (11:40 -0700)
commit0f81b9cb2c5984ae1b090eb79d139e0a7d9ad8df
treeca16fec2de90c29eb4211d180d629b490c2f9c6a
parent79621f3e4151dfe8ef8fdb2800c59dc65f4867e6
pseudo-merge: scaffolding for reads

Implement scaffolding within the new pseudo-merge compilation unit
necessary to use the pseudo-merge API from within the pack-bitmap.c
machinery.

The core of this scaffolding is two-fold:

  - The `pseudo_merge` structure itself, which represents an individual
    pseudo-merge bitmap. It has fields for both bitmaps, as well as
    metadata about its position within the memory-mapped region, and
    a few extra bits indicating whether or not it is satisfied, and
    which bitmaps(s, if any) have been read, since they are initialized
    lazily.

  - The `pseudo_merge_map` structure, which holds an array of
    pseudo_merges, as well as a pointer to the memory-mapped region
    containing the pseudo-merge serialization from within a .bitmap
    file.

Note that the `bitmap_index` structure is defined statically within the
pack-bitmap.o compilation unit, so we can't take in a `struct
bitmap_index *`. Instead, wrap the primary components necessary to read
the pseudo-merges in this new structure to avoid exposing the
implementation details of the `bitmap_index` structure.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pseudo-merge.c
pseudo-merge.h