Skip to main content

Module traversal

Module traversal 

Source
Expand description

Commit graph traversal utilities.

Provides a reusable BFS-based commit walker that correctly handles merge commits with multiple parents. This module exists to prevent the common bug of only following the first parent.

§Example

use void_core::ops::traversal::{CommitWalker, WalkOptions};

let walker = CommitWalker::new(&store, &key, WalkOptions::from_head(&void_dir)?)?;

for result in walker.take(100) {
    let (cid, commit, reader) = result?;
    println!("Commit: {} - {}", cid, commit.message);
}

Structs§

CommitWalker
BFS-based commit graph walker.
WalkOptions
Options for commit traversal.
WalkedCommit
A visited commit with its parsed data.

Enums§

WalkOrder
Walk order for commit traversal.

Functions§

walk_all_refs
Convenience function to walk all commits from all refs.
walk_from_head
Convenience function to walk commits from HEAD.
walk_topological
Walk commits in topological order (root-to-head / oldest first).