Skip to content

Commit

Permalink
revset_graph: split graph into linear segments, emit nodes per segment
Browse files Browse the repository at this point in the history
The original idea was similar to Mercurial's "topo" sorting, but it couldn't
reorder merge-heavy history. In order to render merges of topic branches
nicely, we need to roughly reorder branches at merge point, not at fork point.
To achieve that, we build a graph of linear segments, and walk them from
the head towards the root of the second branch. While walking, descendant
segments of the current segment will also be visited.

Compared to Sapling's beautify_graph(), this is lazy, and can roughly preserve
the index (or chronological) order. I tried beautify_graph() with prioritizing
the @ commit, but the result seemed too aggressively reordered. Perhaps, for
merge-heavy history, beautify_graph() will produce a better result. For my wip
branches (~30 branches, a couple of commits per branch), this works pretty well.

Closes jj-vcs#242
  • Loading branch information
yuja committed Jul 21, 2023
1 parent 985f907 commit 1e9be33
Show file tree
Hide file tree
Showing 14 changed files with 883 additions and 119 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### New features

* `jj log` output is now topologically grouped.
[#242](https://github.com/martinvonz/jj/issues/242)

### Fixed bugs

## [0.8.0] - 2023-07-09
Expand Down
Loading

0 comments on commit 1e9be33

Please sign in to comment.