From: Stefan Beller <sbeller@xxxxxxxxxx> This applies on top of sb/diff-cleanup. The long term strategy is to get the rename detection done, is to run any output through emit_line as there we can either write it to the output file or buffer it internally across file pairs and work on the buffered output. As I got stuck with the word diff as well as the correct implementation of builtin_diff, I am sending this out as an intermediate state. As the diff code is central to Git, I'd rather send these cleanups early so I do not run into merge conflicts with other people down the road. Thanks, Stefan Stefan Beller (10): diff: move line ending check into emit_hunk_header diff: emit_{add, del, context}_line to increase {pre,post}image line count diff.c: drop tautologous condition in emit_line_0 diff.c: rename diff_flush_patch to diff_flush_patch_filepair diff.c: reintroduce diff_flush_patch for all files diff.c: emit_line_0 can handle no color diff.c: convert fn_out_consume to use emit_line_* diff.c: convert emit_rewrite_diff to use emit_line_* diff.c: convert emit_rewrite_lines to use emit_line_0 submodule.c: convert show_submodule_summary to use emit_line_fmt diff.c | 114 ++++++++++++++++++++++++++++++++++++------------------------ diff.h | 3 ++ submodule.c | 42 +++++++++------------- submodule.h | 3 +- 4 files changed, 89 insertions(+), 73 deletions(-) -- 2.7.4