From: Pablo Sabater Date: Sun, 22 Mar 2026 20:38:01 GMT Subject: [GSoC PATCH WIP RFC v3 3/3] graph: add documentation and testing about --graph-lane-limit Message-ID: <20260322203801.637769-3-pabloosabaterr@gmail.com> In-Reply-To: <20260322203801.637769-1-pabloosabaterr@gmail.com> Document --graph-lane-limit option in rev-list-options.adoc with --graph option. Add two tests in t4215 reusing last test graph structure. - --graph-lane-limit=2 on one tip showing only two rendered lanes and the rest replaced with the truncation marker. - --graph-lane-limit=3 with multiple tips, showing only three rendered lanes. Signed-off-by: Pablo Sabater --- Documentation/rev-list-options.adoc | 5 +++ t/t4215-log-skewed-merges.sh | 53 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/Documentation/rev-list-options.adoc b/Documentation/rev-list-options.adoc index 2d195a1474..1819228b60 100644 --- a/Documentation/rev-list-options.adoc +++ b/Documentation/rev-list-options.adoc @@ -1259,6 +1259,11 @@ This implies the `--topo-order` option by default, but the in between them in that case. If __ is specified, it is the string that will be shown instead of the default one. +`graph-lane-limit=`:: + When `--graph` is used, limit the number of graph lanes to be shown. + Lanes over the limit are replaced with a truncation mark '.'. By default + there is no limit. + ifdef::git-rev-list[] `--count`:: Print a number stating how many commits would have been diff --git a/t/t4215-log-skewed-merges.sh b/t/t4215-log-skewed-merges.sh index 28d0779a8c..657e3ff2a5 100755 --- a/t/t4215-log-skewed-merges.sh +++ b/t/t4215-log-skewed-merges.sh @@ -370,4 +370,57 @@ test_expect_success 'log --graph with multiple tips' ' EOF ' +test_expect_success 'log --graph --graph-lane-limit=2 limited to two columns' ' + check_graph --graph-lane-limit=2 M_7 <<-\EOF + *-. 7_M4 + |\ \ + | | * 7_G + | | * 7_F + | * . 7_E + | * . 7_D + * | . 7_C + | |/ + |/| + * | 7_B + |/ + * 7_A + EOF +' + +test_expect_success 'log --graph --graph-lane-limit=3 limited to three columns' ' + check_graph --graph-lane-limit=3 M_1 M_3 M_5 M_7 <<-\EOF + * 7_M1 + |\ + | | * 7_M2 + | | |\ + | | | * 7_H + | | | . 7_M3 + | | | . 7_J + | | | . 7_I + | | | . 7_M4 + | |_|_. + |/| | . + | | |_. + | |/| . + | | | . + | | |/. + | | * . 7_G + | | | . + | | |/. + | | * . 7_F + | * | . 7_E + | | |/. + | |/| . + | * | . 7_D + | | |/ + | |/| + * | | 7_C + | |/ + |/| + * | 7_B + |/ + * 7_A + EOF +' + test_done -- 2.43.0