Skip to content

Commit 7262188

Browse files
committed
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.
1 parent 3b10fbc commit 7262188

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

Documentation/rev-list-options.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ Under `--pretty=reference`, this information will not be shown at all.
349349

350350
`--boundary`::
351351
Output excluded boundary commits. Boundary commits are
352-
prefixed with `-`.
352+
prefixed with `^`.
353353

354354
ifdef::git-rev-list[]
355355
`--use-bitmap-index`::
@@ -1211,7 +1211,7 @@ endif::git-rev-list[]
12111211
Mark which side of a symmetric difference a commit is reachable from.
12121212
Commits from the left side are prefixed with `<` and those from
12131213
the right with `>`. If combined with `--boundary`, those
1214-
commits are prefixed with `-`.
1214+
commits are prefixed with `^`.
12151215
+
12161216
For example, if you have this topology:
12171217
+
@@ -1232,8 +1232,8 @@ you would get an output like this:
12321232
>bbbbbbb... 2nd on b
12331233
<aaaaaaa... 3rd on a
12341234
<aaaaaaa... 2nd on a
1235-
-yyyyyyy... 1st on b
1236-
-xxxxxxx... 1st on a
1235+
^yyyyyyy... 1st on b
1236+
^xxxxxxx... 1st on a
12371237
-----------------------------------------------------------------------
12381238

12391239
`--graph`::

graph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,12 +938,12 @@ static void graph_output_pre_commit_line(struct git_graph *graph,
938938
static void graph_output_commit_char(struct git_graph *graph, struct graph_line *line)
939939
{
940940
/*
941-
* For boundary commits, print 'o'
941+
* For boundary commits, print '^'
942942
* (We should only see boundary commits when revs->boundary is set.)
943943
*/
944944
if (graph->commit->object.flags & BOUNDARY) {
945945
assert(graph->revs->boundary);
946-
graph_line_addch(line, 'o');
946+
graph_line_addch(line, '^');
947947
return;
948948
}
949949

perl/Git/SVN/Log.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ sub cmd_show_log {
285285
my (@k, $c, $d, $stat);
286286
my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
287287
while (<$log>) {
288-
if (/^${esc_color}commit (?:- )?($::oid_short)/o) {
288+
if (/^${esc_color}commit (?:\^ )?($::oid_short)/o) {
289289
my $cmt = $1;
290290
if ($c && cmt_showable($c) && $c->{r} != $r_last) {
291291
$r_last = $c->{r};

revision.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4531,7 +4531,7 @@ struct commit *get_revision(struct rev_info *revs)
45314531
const char *get_revision_mark(const struct rev_info *revs, const struct commit *commit)
45324532
{
45334533
if (commit->object.flags & BOUNDARY)
4534-
return "-";
4534+
return "^";
45354535
else if (commit->object.flags & UNINTERESTING)
45364536
return "U";
45374537
else if (commit->object.flags & PATCHSAME)

t/t3430-rebase-merges.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' '
269269
| * A1
270270
* | B1
271271
|/
272-
o A2
272+
^ A2
273273
EOF
274274
'
275275

@@ -279,7 +279,7 @@ test_expect_success '--no-rebase-merges countermands --rebase-merges' '
279279
test_cmp_graph C.. <<-\EOF
280280
* B
281281
* D
282-
o C
282+
^ C
283283
EOF
284284
'
285285

@@ -297,7 +297,7 @@ test_expect_success 'do not rebase cousins unless asked for' '
297297
| * D
298298
| * G
299299
|/
300-
o H
300+
^ H
301301
EOF
302302
'
303303

@@ -311,7 +311,7 @@ test_expect_success 'rebase.rebaseMerges=rebase-cousins is equivalent to --rebas
311311
| * D
312312
| * G
313313
|/
314-
o H
314+
^ H
315315
EOF
316316
'
317317

@@ -322,7 +322,7 @@ test_expect_success '--no-rebase-merges overrides rebase.rebaseMerges=no-rebase-
322322
test_cmp_graph C.. <<-\EOF
323323
* B
324324
* D
325-
o C
325+
^ C
326326
EOF
327327
'
328328

@@ -456,7 +456,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
456456
* Merge branch '\''khnum'\'' into asherah
457457
|\
458458
| * yama
459-
o shamkat
459+
^ shamkat
460460
EOF
461461
test_tick &&
462462
git rebase --rebase-merges=rebase-cousins HEAD^ &&
@@ -465,7 +465,7 @@ test_expect_success 'A root commit can be a cousin, treat it that way' '
465465
|\
466466
| * yama
467467
|/
468-
o shamkat
468+
^ shamkat
469469
EOF
470470
'
471471

@@ -515,7 +515,7 @@ test_expect_success 'octopus merges' '
515515
| |/
516516
* / one
517517
|/
518-
o before-octopus
518+
^ before-octopus
519519
EOF
520520
'
521521

t/t6016-rev-list-graph-simplify-history.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ test_expect_success '--graph --boundary ^C3' '
233233
| * | | B2
234234
| * | | B1
235235
* | | | A3
236-
o | | | A2
236+
^ | | | A2
237237
|/ / /
238-
o / / A1
238+
^ / / A1
239239
/ /
240-
| o C3
240+
| ^ C3
241241
|/
242-
o C2
242+
^ C2
243243
EOF
244244
'
245245

0 commit comments

Comments
 (0)