Skip to main content

build_graph

Function build_graph 

Source
pub fn build_graph(commits: &[CommitInfo]) -> Vec<GraphRow>
Expand description

Build a graph layout for a slice of commits (newest-first).

The algorithm maintains a set of “active lanes” — columns that carry a branch line downward through the graph. Each lane tracks the OID of the next commit it expects to encounter. When a commit is found, its lane becomes the node column, and the commit’s parents are assigned to lanes (using the current lane for the first parent and allocating new lanes for any additional parents).