From 81401786866e204bd8cfe66d5a4a5225ca2009da Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 30 Jun 2022 15:32:13 +0200 Subject: [PATCH] log: show ^ for boundary Boundary commits are commits which are discarded by the revision walk, i.e. they are no "positive part" of the specified revision set but show nevertheless (because of `--boundary`). So far, `log` shows them with a `-` prefix and `log --graph` with a `o`. besides the obvious inconsistency, these choices are bad for other reasons, too: `-` is typically used in a diff whereas negative revs are denoted by `^`. `o` reminds of "origin/origo" at least as much as of "omitted"; visually, it's not clear that it "should not be present". So, change both `log` and `log --graph` to use the same symbol `^` which the revision parser uses for negative revs, too. --- Documentation/rev-list-options.txt | 8 ++++---- graph.c | 4 ++-- perl/Git/SVN/Log.pm | 2 +- revision.c | 2 +- t/t3430-rebase-merges.sh | 16 ++++++++-------- t/t6016-rev-list-graph-simplify-history.sh | 8 ++++---- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index e6468bf0eb8e11..2fdf192822c295 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -340,7 +340,7 @@ Under `--pretty=reference`, this information will not be shown at all. --boundary:: Output excluded boundary commits. Boundary commits are - prefixed with `-`. + prefixed with `^`. ifdef::git-rev-list[] --use-bitmap-index:: @@ -1145,7 +1145,7 @@ endif::git-rev-list[] Mark which side of a symmetric difference a commit is reachable from. Commits from the left side are prefixed with `<` and those from the right with `>`. If combined with `--boundary`, those - commits are prefixed with `-`. + commits are prefixed with `^`. + For example, if you have this topology: + @@ -1166,8 +1166,8 @@ you would get an output like this: >bbbbbbb... 2nd on b boundary is set.) */ if (graph->commit->object.flags & BOUNDARY) { assert(graph->revs->boundary); - graph_line_addch(line, 'o'); + graph_line_addch(line, '^'); return; } diff --git a/perl/Git/SVN/Log.pm b/perl/Git/SVN/Log.pm index cc8b484f848028..95671afd7f7c78 100644 --- a/perl/Git/SVN/Log.pm +++ b/perl/Git/SVN/Log.pm @@ -285,7 +285,7 @@ sub cmd_show_log { my (@k, $c, $d, $stat); my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/; while (<$log>) { - if (/^${esc_color}commit (?:- )?($::oid_short)/o) { + if (/^${esc_color}commit (?:\^ )?($::oid_short)/o) { my $cmt = $1; if ($c && cmt_showable($c) && $c->{r} != $r_last) { $r_last = $c->{r}; diff --git a/revision.c b/revision.c index ed9439b10b246c..d8ed3f1f62de3c 100644 --- a/revision.c +++ b/revision.c @@ -4363,7 +4363,7 @@ struct commit *get_revision(struct rev_info *revs) const char *get_revision_mark(const struct rev_info *revs, const struct commit *commit) { if (commit->object.flags & BOUNDARY) - return "-"; + return "^"; else if (commit->object.flags & UNINTERESTING) return "U"; else if (commit->object.flags & PATCHSAME) diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh index ac5c390652f381..2b2c64b49e3804 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -246,7 +246,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' ' | * A1 * | B1 |/ - o A2 + ^ A2 EOF ' @@ -256,7 +256,7 @@ test_expect_success '--no-rebase-merges countermands --rebase-merges' ' test_cmp_graph C.. <<-\EOF * B * D - o C + ^ C EOF ' @@ -274,7 +274,7 @@ test_expect_success 'do not rebase cousins unless asked for' ' | * D | * G |/ - o H + ^ H EOF ' @@ -288,7 +288,7 @@ test_expect_success 'rebase.rebaseMerges=rebase-cousins is equivalent to --rebas | * D | * G |/ - o H + ^ H EOF ' @@ -299,7 +299,7 @@ test_expect_success '--no-rebase-merges overrides rebase.rebaseMerges=no-rebase- test_cmp_graph C.. <<-\EOF * B * D - o C + ^ C EOF ' @@ -434,7 +434,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' ' * Merge branch '\''khnum'\'' into asherah |\ | * yama - o shamkat + ^ shamkat EOF test_tick && git rebase --rebase-merges=rebase-cousins HEAD^ && @@ -443,7 +443,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' ' |\ | * yama |/ - o shamkat + ^ shamkat EOF ' @@ -493,7 +493,7 @@ test_expect_success 'octopus merges' ' | |/ * / one |/ - o before-octopus + ^ before-octopus EOF ' diff --git a/t/t6016-rev-list-graph-simplify-history.sh b/t/t6016-rev-list-graph-simplify-history.sh index 54b0a6f5f8a4b2..b971b3dc91bcc0 100755 --- a/t/t6016-rev-list-graph-simplify-history.sh +++ b/t/t6016-rev-list-graph-simplify-history.sh @@ -233,13 +233,13 @@ test_expect_success '--graph --boundary ^C3' ' | * | | B2 | * | | B1 * | | | A3 - o | | | A2 + ^ | | | A2 |/ / / - o / / A1 + ^ / / A1 / / - | o C3 + | ^ C3 |/ - o C2 + ^ C2 EOF '