Re: [RFC/PATCH 16/17] diff: buffer output in emit_line_0

2016-09-13 Thread Stefan Beller
On Tue, Sep 13, 2016 at 4:32 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> So would we rather want to keep the ecbdata around for each file pair and >> just reference that? I thought we deliberately want to avoid ecbdata, so >> maybe >> we rather want to have another struct that keeps p

Re: [RFC/PATCH 16/17] diff: buffer output in emit_line_0

2016-09-13 Thread Junio C Hamano
Stefan Beller writes: > So would we rather want to keep the ecbdata around for each file pair and > just reference that? I thought we deliberately want to avoid ecbdata, so maybe > we rather want to have another struct that keeps path related information > around (pointer to the blob and white sp

Re: [RFC/PATCH 16/17] diff: buffer output in emit_line_0

2016-09-13 Thread Stefan Beller
On Tue, Sep 13, 2016 at 4:06 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> +struct line_emission { >> + const char *set; >> + const char *line; >> + const char *ws; >> + const char *reset; >> + int first; >> + int len; >> + int whitespace_check; >> + unsig

Re: [RFC/PATCH 16/17] diff: buffer output in emit_line_0

2016-09-13 Thread Junio C Hamano
Stefan Beller writes: > +struct line_emission { > + const char *set; > + const char *line; > + const char *ws; > + const char *reset; > + int first; > + int len; > + int whitespace_check; > + unsigned ws_rule; > + int has_trailing_carriage_return; > + int h

[RFC/PATCH 16/17] diff: buffer output in emit_line_0

2016-09-12 Thread Stefan Beller
emit_line_0 factors out the emission part into emit_line_emission, and depending on the diff_options->use_buffer the emission will be performed directly when calling emit_line_0 or after the whole process is done, i.e. by buffering we have add the possibility for a second pass over the whole output