diff options
author | Taylor Blau <me@ttaylorr.com> | 2024-05-23 23:26:23 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-24 20:40:41 +0200 |
commit | 4722e06edcbb57142387081684b41eda2a6cf635 (patch) | |
tree | efa7f80cc9826606cac3c0aaa879bfdea68d7058 /pseudo-merge.c | |
parent | ewah: implement `ewah_bitmap_is_subset()` (diff) | |
download | git-4722e06edcbb57142387081684b41eda2a6cf635.tar.xz git-4722e06edcbb57142387081684b41eda2a6cf635.zip |
pack-bitmap: move some initialization to `bitmap_writer_init()`
The pack-bitmap-writer machinery uses a oidmap (backed by khash.h) to
map from commits selected for bitmaps (by OID) to a bitmapped_commit
structure (containing the bitmap itself, among other things like its XOR
offset, etc.)
This map was initialized at the end of `bitmap_writer_build()`. New
entries are added in `pack-bitmap-write.c::store_selected()`, which is
called by the bitmap_builder machinery (which is responsible for
traversing history and generating the actual bitmaps).
Reorganize when this field is initialized and when entries are added to
it so that we can quickly determine whether a commit is a candidate for
pseudo-merge selection, or not (since it was already selected to receive
a bitmap, and thus storing it in a pseudo-merge would be redundant).
The changes are as follows:
- Introduce a new `bitmap_writer_init()` function which initializes
the `writer.bitmaps` field (instead of waiting until the end of
`bitmap_writer_build()`).
- Add map entries in `push_bitmapped_commit()` (which is called via
`bitmap_writer_select_commits()`) with OID keys and NULL values to
track whether or not we *expect* to write a bitmap for some given
commit.
- Validate that a NULL entry is found matching the given key when we
store a selected bitmap.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pseudo-merge.c')
0 files changed, 0 insertions, 0 deletions