log: fix coloring of certain octopus merge shapes
commit04005834ed07e0b3a63793f386570c8bcf73f9a3
authorNoam Postavsky <npostavs@users.sourceforge.net>
Sun, 2 Sep 2018 00:07:16 +0000 (1 20:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Oct 2018 03:22:48 +0000 (12 12:22 +0900)
treeea5188d2ff343854b64fad8572dbd9c8083a9009
parentd0832b2847aa9669c09397c5639d7fe56abaf9fc
log: fix coloring of certain octopus merge shapes

For octopus merges where the first parent edge immediately merges into
the next column to the left, the number of columns should be one less
than the usual case.

First parent to the left case:

| *-.
| |\ \
|/ / /

The usual case:

| *-.
| |\ \
| | | *

Also refactor the code to iterate over columns rather than dashes,
building from an initial patch suggested by Jeff King.

Signed-off-by: Noam Postavsky <npostavs@users.sourceforge.net>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
graph.c
t/t4214-log-graph-octopus.sh [new file with mode: 0755]