On 10/10/2019 12:13 PM, James Coglan via GitGitGadget wrote:
> From: James Coglan <[email protected]>
>
> Currently, when we display a merge whose first parent is already present
> in a column to the left of the merge commit, we display the first parent
> as a veritcal pipe `|` in the GRAPH_POST_MERGE line and then immediately
> enter the GRAPH_COLLAPSING state. The first-parent line tracks to the
> left and all the other parent lines follow it; this creates a "kink" in
> those lines:
>
> | *---.
> | |\ \ \
> |/ / / /
> | | | *
>
> This change tidies the display of such commits such that if the first
> parent appears to the left of the merge, we render it as a `/` and the
> second parent as a `|`. This reduces the horizontal and vertical space
> needed to render the merge, and makes the resulting lines easier to
> read.
>
> | *-.
> |/|\ \
> | | | *
>
> If the first parent is separated from the merge by several columns, a
> horizontal line is drawn in a similar manner to how the GRAPH_COLLAPSING
> state displays the line.
>
> | | | *-.
> | |_|/|\ \
> |/| | | | *
>
> This effect is applied to both "normal" two-parent merges, and to
> octopus merges. It also reduces the vertical space needed for pre-commit
> lines, as the merge occupies one less column than usual.
>
> Before: After:
>
> | * | *
> | |\ | |\
> | | \ | * \
> | | \ |/|\ \
> | *-. \
> | |\ \ \
>
Thank you for adding these careful diagrams both to the message
and the code. These concepts are hard to track without a visual
aid.
[snip]
> +++ b/t/t4215-log-skewed-merges.sh
> @@ -0,0 +1,42 @@
> +#!/bin/sh
> +
> +test_description='git log --graph of skewed merges'
> +
> +. ./test-lib.sh
> +
> +test_expect_success 'setup left-skewed merge' '
Could you skew this example to include a left-skewed octopus merge
(and use fewer Git processes) with the following:
git checkout --orphan _a && test_commit A &&
git switch -c _b _a && test_commit B &&
git switch -c _c _a && test_commit C &&
git switch -c _d _a && test_commit D && git switch -c _e _b && git
merge --no-ff _c _d E &&
git switch -c _f _a && git merge --no-ff _d -m F && git checkout _a
&& git merge --no-ff _b _c _e _f -m G
and I think the resulting output will be:
*-----. G
|\ \ \ \
| | | | * F
| |_|_|/|
|/| | | |
| | | * | E
| |_|/|\|
|/| | | |
| | |/ * D
| |_|__/
|/| |
| | * C
| |/
|/|
| * B
|/
* A