From 9c423b89d7b41682e775cc14f9be48d936f430e4 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 00ccf68744103d..0f6623dcce626f 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -349,7 +349,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:: @@ -1158,7 +1158,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: + @@ -1179,8 +1179,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 6ae1e7b84bdbbf..771077290130d5 100644 --- a/revision.c +++ b/revision.c @@ -4493,7 +4493,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 36ca126bcdf9a5..8b28a838d88437 100755 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@ -261,7 +261,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' ' | * A1 * | B1 |/ - o A2 + ^ A2 EOF ' @@ -271,7 +271,7 @@ test_expect_success '--no-rebase-merges countermands --rebase-merges' ' test_cmp_graph C.. <<-\EOF * B * D - o C + ^ C EOF ' @@ -289,7 +289,7 @@ test_expect_success 'do not rebase cousins unless asked for' ' | * D | * G |/ - o H + ^ H EOF ' @@ -303,7 +303,7 @@ test_expect_success 'rebase.rebaseMerges=rebase-cousins is equivalent to --rebas | * D | * G |/ - o H + ^ H EOF ' @@ -314,7 +314,7 @@ test_expect_success '--no-rebase-merges overrides rebase.rebaseMerges=no-rebase- test_cmp_graph C.. <<-\EOF * B * D - o C + ^ C EOF ' @@ -449,7 +449,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^ && @@ -458,7 +458,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' ' |\ | * yama |/ - o shamkat + ^ shamkat EOF ' @@ -508,7 +508,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 '