diff options
author | James Coglan <jcoglan@gmail.com> | 2019-10-15 23:47:57 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-16 02:11:25 (GMT) |
commit | 479db18bc0c38ed610fba56f3cc98abd7977e695 (patch) | |
tree | 2afb51bffdcba98597eeea727e9458993daca110 /t/t6016-rev-list-graph-simplify-history.sh | |
parent | 0195285b956e1b52defa6c259253a7b888fc25df (diff) | |
download | git-479db18bc0c38ed610fba56f3cc98abd7977e695.zip git-479db18bc0c38ed610fba56f3cc98abd7977e695.tar.gz git-479db18bc0c38ed610fba56f3cc98abd7977e695.tar.bz2 |
graph: smooth appearance of collapsing edges on commit lines
When a graph contains edges that are in the process of collapsing to the
left, but those edges cross a commit line, the effect is that the edges
have a jagged appearance:
*
|\
| *
| \
*-. \
|\ \ \
| | * |
| * | |
| |/ /
* | |
|/ /
* |
|/
*
We already takes steps to smooth edges like this when they're expanding;
when an edge appears to the right of a merge commit marker on a
GRAPH_COMMIT line immediately following a GRAPH_POST_MERGE line, we
render it as a `\`:
* \
|\ \
| * \
| |\ \
We can make a similar improvement to collapsing edges, making them
easier to follow and giving the overall graph a feeling of increased
symmetry:
*
|\
| *
| \
*-. \
|\ \ \
| | * |
| * | |
| |/ /
* / /
|/ /
* /
|/
*
To do this, we introduce a new special case for edges on GRAPH_COMMIT
lines that immediately follow a GRAPH_COLLAPSING line. By retaining a
copy of the `mapping` array used to render the GRAPH_COLLAPSING line in
the `old_mapping` array, we can determine that an edge is collapsing
through the GRAPH_COMMIT line and should be smoothed.
Signed-off-by: James Coglan <jcoglan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6016-rev-list-graph-simplify-history.sh')
-rwxr-xr-x | t/t6016-rev-list-graph-simplify-history.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh index f7181d1..ca1682f 100755 --- a/t/t6016-rev-list-graph-simplify-history.sh +++ b/t/t6016-rev-list-graph-simplify-history.sh @@ -154,7 +154,7 @@ test_expect_success '--graph --full-history -- bar.txt' ' echo "* | $A4" >> expected && echo "|\\ \\ " >> expected && echo "| |/ " >> expected && - echo "* | $A3" >> expected && + echo "* / $A3" >> expected && echo "|/ " >> expected && echo "* $A2" >> expected && git rev-list --graph --full-history --all -- bar.txt > actual && @@ -255,7 +255,7 @@ test_expect_success '--graph --boundary ^C3' ' echo "* | | | $A3" >> expected && echo "o | | | $A2" >> expected && echo "|/ / / " >> expected && - echo "o | | $A1" >> expected && + echo "o / / $A1" >> expected && echo " / / " >> expected && echo "| o $C3" >> expected && echo "|/ " >> expected && |