Skip to content

Commit a05fd94

Browse files
pabloosabaterrgitster
authored andcommitted
graph: add documentation and tests about --graph-lane-limit
Document --graph-lane-limit option in rev-list-options.adoc with --graph option. Add two tests in t4215 reusing existing graphs. The first test limits to two lanes on a single tip and the second one limits to three lanes on multiple tips. Both tests check that everything is truncated correctly. Signed-off-by: Pablo Sabater <pabloosabaterr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent cfb35b5 commit a05fd94

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

Documentation/rev-list-options.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,11 @@ This implies the `--topo-order` option by default, but the
12591259
in between them in that case. If _<barrier>_ is specified, it
12601260
is the string that will be shown instead of the default one.
12611261

1262+
`--graph-lane-limit=<n>`::
1263+
When `--graph` is used, limit the number of graph lanes to be shown.
1264+
Lanes over the limit are replaced with a truncation mark '.'. By default
1265+
there is no limit.
1266+
12621267
ifdef::git-rev-list[]
12631268
`--count`::
12641269
Print a number stating how many commits would have been

t/t4215-log-skewed-merges.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,57 @@ test_expect_success 'log --graph with multiple tips' '
370370
EOF
371371
'
372372

373+
test_expect_success 'log --graph --graph-lane-limit=2 limited to two lanes' '
374+
check_graph --graph-lane-limit=2 M_7 <<-\EOF
375+
*-. 7_M4
376+
|\ \
377+
| | * 7_G
378+
| | * 7_F
379+
| * . 7_E
380+
| * . 7_D
381+
* | . 7_C
382+
| |/
383+
|/|
384+
* | 7_B
385+
|/
386+
* 7_A
387+
EOF
388+
'
389+
390+
test_expect_success 'log --graph --graph-lane-limit=3 limited to three lanes' '
391+
check_graph --graph-lane-limit=3 M_1 M_3 M_5 M_7 <<-\EOF
392+
* 7_M1
393+
|\
394+
| | * 7_M2
395+
| | |\
396+
| | | * 7_H
397+
| | | . 7_M3
398+
| | | . 7_J
399+
| | | . 7_I
400+
| | | . 7_M4
401+
| |_|_.
402+
|/| | .
403+
| | |_.
404+
| |/| .
405+
| | | .
406+
| | |/.
407+
| | * . 7_G
408+
| | | .
409+
| | |/.
410+
| | * . 7_F
411+
| * | . 7_E
412+
| | |/.
413+
| |/| .
414+
| * | . 7_D
415+
| | |/
416+
| |/|
417+
* | | 7_C
418+
| |/
419+
|/|
420+
* | 7_B
421+
|/
422+
* 7_A
423+
EOF
424+
'
425+
373426
test_done

0 commit comments

Comments
 (0)