Skip to content

Draw a commit graph in History - #15

Merged
VedangP57 merged 18 commits into
mainfrom
feat/commit-graph
Oct 19, 2026
Merged

VedangP57 merged 18 commits into
mainfrom
feat/commit-graph

Conversation

@VedangP57

Copy link
Copy Markdown
Owner

What

  • History gets a graph column: a dot per commit and coloured lines for branches and merges. On by default; L toggles it, history_graph in the config sets the default.
  • Hidden during search, a path filter, V ranges and compare mode, and in a History pane under 48 columns.
  • With the graph on, History is in topological order (git's rev-list --topo-order); off, it is the old date order.
  • The art comes from git log --graph (parsed and recoloured, glyph map and lane colouring adapted from druk, MIT, credited). Each art row is checked against the commit beside it; on a mismatch the graph stops instead of drawing wrong lines.
  • Pages load as you scroll (256 rows, then doubling), on the low-priority pool, and a bigger request cancels a smaller one in flight. Refs go to git over stdin, so repos with tens of thousands of refs work.
  • Connector lines are folded into the commit row above, so selection never lands on one; clicking one selects the commit above.

Known limits

  • Lane colours are per column, so a branch changes colour when it moves column (a native lane version comes later).
  • On a very large repo without a commit-graph file the graph can take a second or more on first open (documented).
  • G on a huge repo holds the art for every row in memory.

Review

An opus whole-branch review found cost problems (graph pages on the main reader pool, refs on argv, missing tests); all fixed in the last two commits.

Tests

cargo test --workspace and clippy are clean. Not yet seen in a real terminal.

@VedangP57
VedangP57 merged commit 9d5a430 into main Oct 19, 2026
10 checks passed
@VedangP57
VedangP57 deleted the feat/commit-graph branch October 19, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant