Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-06 Thread Stefan Beller
On Tue, Sep 6, 2016 at 5:44 AM, Junio C Hamano wrote: > By the way, not running xdiff twice would also remove another worry > I have about correctness, in that the approach depends on xdiff > machinery to produce byte-for-byte identical result given the same > pair of input.

Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-06 Thread Junio C Hamano
Stefan Beller writes: > This new coloring is linear to the size of the patch, i.e. O(number of > added/removed lines) in memory and for computational efforts I'd > think it is O(n log n) as inserting into the hashmap is an amortized > log n. In addition to that O(n log n)

Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-05 Thread Stefan Beller
On Mon, Sep 5, 2016 at 6:09 PM, Jacob Keller wrote: > On Mon, Sep 5, 2016 at 11:57 AM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> diff --git a/Documentation/config.txt b/Documentation/config.txt >>> index

Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-05 Thread Stefan Beller
On Mon, Sep 5, 2016 at 11:57 AM, Junio C Hamano wrote: >> + `new` (added lines), `commit` (commit headers), `whitespace` >> + (highlighting whitespace errors), `moved-old` (removed lines that >> + reappear), `moved-new` (added lines that were removed elsewhere). > >

Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-05 Thread Jacob Keller
On Mon, Sep 5, 2016 at 11:57 AM, Junio C Hamano wrote: > Stefan Beller writes: > >> diff --git a/Documentation/config.txt b/Documentation/config.txt >> index 0bcb679..f4f51c2 100644 >> --- a/Documentation/config.txt >> +++ b/Documentation/config.txt >>

Re: [WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-05 Thread Junio C Hamano
Stefan Beller writes: > diff --git a/Documentation/config.txt b/Documentation/config.txt > index 0bcb679..f4f51c2 100644 > --- a/Documentation/config.txt > +++ b/Documentation/config.txt > @@ -980,8 +980,9 @@ color.diff.:: > of `context` (context text - `plain` is a

[WIP PATCH v2] diff.c: emit moved lines with a different color

2016-09-04 Thread Stefan Beller
From: Stefan Beller When we color the diff, we'll mark moved lines with a different color. This is achieved by doing a two passes over the diff. The first pass will inspect each line of the diff and store the removed lines and the added lines in its own hash map. The second