Re: [BUG] log --graph corrupts patch
From: Junio C Hamano <hidden>
Date: 2018-03-21 17:23:44
Jeff King [off-list ref] writes:
quoted
To make it bullet-proof, I think we'd have to actually parse the graph structure, finding a "*" line and then accepting only an indent that matched it.Wow. Nerd snipe successful. This turned out to be quite tricky, but also kind of interesting.
The last patch looks quite "interesting" ;-). The idea is sound and probably the execution, too, but it indeed is tricky.
Here's a series which fixes it. The meaty bits are in the final commit; the rest is just preparatory cleanup, and adding some tests (all are cases which I managed to break while fixing this). [1/7]: diff-highlight: correct test graph diagram [2/7]: diff-highlight: use test_tick in graph test [3/7]: diff-highlight: prefer "echo" to "cat" in tests [4/7]: diff-highlight: test interleaved parallel lines of history [5/7]: diff-highlight: test graphs with --color [6/7]: diff-highlight: factor out flush_hunk() helper [7/7]: diff-highlight: detect --graph by indent contrib/diff-highlight/DiffHighlight.pm | 89 +++++++++++++++---- .../diff-highlight/t/t9400-diff-highlight.sh | 81 +++++++++++++---- 2 files changed, 133 insertions(+), 37 deletions(-) -Peff