Re: [RFC/PATCH 01/17] diff: move line ending check into emit_hunk_header

2016-09-13 Thread Stefan Beller
On Tue, Sep 13, 2016 at 7:42 AM, René Scharfe wrote: >> >> strbuf_add(, line + len, org_len - len); >> + if (line[org_len - 1] != '\n') >> + strbuf_addch(, '\n'); >> + > > > Using strbuf_complete_line() would be nicer. That makes sense! Thanks, Stefan

Re: [RFC/PATCH 01/17] diff: move line ending check into emit_hunk_header

2016-09-13 Thread René Scharfe
Am 13.09.2016 um 06:45 schrieb Stefan Beller: In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines

[RFC/PATCH 01/17] diff: move line ending check into emit_hunk_header

2016-09-12 Thread Stefan Beller
In a later patch, I want to propose an option to detect moved lines in a diff, which cannot be done in a one-pass over the diff. Instead we need to go over the whole diff twice, because we cannot detect the first line of the two corresponding lines (+ and -) that got moved. So to prepare the diff