pack-bitmap-write: fill bitmap with commit history
authorDerrick Stolee <redacted>
Tue, 8 Dec 2020 22:04:03 +0000 (17:04 -0500)
committerJunio C Hamano <redacted>
Tue, 8 Dec 2020 22:48:16 +0000 (14:48 -0800)
commit6dc5ef759f25fbded11d235362c59f59498809e6
treebc613bec149e086e16c4c952885fab1d9edc0913
parent010e5eacfb004218087da054a61772da8fc40463
pack-bitmap-write: fill bitmap with commit history

The current implementation of bitmap_writer_build() creates a
reachability bitmap for every walked commit. After computing a bitmap
for a commit, those bits are pushed to an in-progress bitmap for its
children.

fill_bitmap_commit() assumes the bits corresponding to objects
reachable from the parents of a commit are already set. This means that
when visiting a new commit, we only have to walk the objects reachable
between it and any of its parents.

A future change to bitmap_writer_build() will relax this condition so
not all parents have their bits set. Prepare for that by having
'fill_bitmap_commit()' walk parents until reaching commits whose bits
are already set. Then, walk the trees for these commits as well.

This has no functional change with the current implementation of
bitmap_writer_build().

Signed-off-by: Derrick Stolee <redacted>
Signed-off-by: Taylor Blau <redacted>
Signed-off-by: Junio C Hamano <redacted>
pack-bitmap-write.c
git clone https://git.99rst.org/PROJECT