Re: [PATCH 3/9] diff: avoid generating unused hunk header lines

2018-11-02 Thread Junio C Hamano
Jeff King writes: >> to have *some* names there, for the sake of a >> simply described coding style without many exceptions >> (especially those exceptions that rely on judgement). > > Fair enough. For the record, there aren't "many" exceptions to the rule that was suggested earlier: if you refe

Re: [PATCH 3/9] diff: avoid generating unused hunk header lines

2018-11-02 Thread Jeff King
On Fri, Nov 02, 2018 at 12:50:05PM -0700, Stefan Beller wrote: > > +/* > > + * Can be used as a no-op hunk_fn for xdi_diff_outf(), since a NULL > > + * one just sends the hunk line to the line_fn callback). > > + */ > > +void discard_hunk_line(void *, long, long, long, long, const char *, long); >

Re: [PATCH 3/9] diff: avoid generating unused hunk header lines

2018-11-02 Thread Stefan Beller
> +/* > + * Can be used as a no-op hunk_fn for xdi_diff_outf(), since a NULL > + * one just sends the hunk line to the line_fn callback). > + */ > +void discard_hunk_line(void *, long, long, long, long, const char *, long); Recently we had the discussion on style and naming things. On the one hand

[PATCH 3/9] diff: avoid generating unused hunk header lines

2018-11-01 Thread Jeff King
Some callers of xdi_diff_outf() do not look at the generated hunk header lines at all. By plugging in a no-op hunk callback, this tells xdiff not to even bother formatting them. This patch introduces a stock no-op callback and uses it with a few callers whose line callbacks explicitly ignore hunk