Skip to main content

accumulate

Function accumulate 

Source
pub fn accumulate(
    row: u32,
    view: &ReachView<'_>,
    facts: &ObjectFacts<'_>,
    acc: &mut RoaringBitmap,
)
Expand description

The bounded walk: OR into acc everything reachable from the commit at row, stopping at every commit that already has a bitmap.

A stored bitmap is closed under reachability, so reaching one accounts for the entire history behind it; what the walk covers is only what has been pushed since the table last covered it, whatever the repository’s size. This is git’s add_to_include_set rule.

The two phases are an ordering, not a style: the commit walk runs to completion before a single tree is opened, so that every stored bitmap the request will OR in is already in acc when the tree walk’s skip rule runs. Get it wrong and the first unbitmapped commit costs a walk of every tree in the repository.