From: Junio C Hamano Date: Fri, 19 Sep 2008 02:53:12 +0000 (-0700) Subject: Merge branch 'jc/maint-diff-quiet' into maint X-Git-Tag: v1.6.0.3~79 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/01409bbf75198289591ba9dfe2c8d2370b36a058?ds=inline;hp=-c Merge branch 'jc/maint-diff-quiet' into maint * jc/maint-diff-quiet: diff --quiet: make it synonym to --exit-code >/dev/null diff Porcelain: do not disable auto index refreshing on -C -C --- 01409bbf75198289591ba9dfe2c8d2370b36a058 diff --combined diff.c index 5e01b2bb27,13be211568..9385a36f1e --- a/diff.c +++ b/diff.c @@@ -511,20 -511,13 +511,20 @@@ const char *diff_get_color(int diff_use static void emit_line(FILE *file, const char *set, const char *reset, const char *line, int len) { - int has_trailing_newline = (len > 0 && line[len-1] == '\n'); + int has_trailing_newline, has_trailing_carriage_return; + + has_trailing_newline = (len > 0 && line[len-1] == '\n'); if (has_trailing_newline) len--; + has_trailing_carriage_return = (len > 0 && line[len-1] == '\r'); + if (has_trailing_carriage_return) + len--; fputs(set, file); fwrite(line, len, 1, file); fputs(reset, file); + if (has_trailing_carriage_return) + fputc('\r', file); if (has_trailing_newline) fputc('\n', file); } @@@ -2400,13 -2393,6 +2400,6 @@@ int diff_setup_done(struct diff_option DIFF_OPT_SET(options, EXIT_WITH_STATUS); } - /* - * If we postprocess in diffcore, we cannot simply return - * upon the first hit. We need to run diff as usual. - */ - if (options->pickaxe || options->filter) - DIFF_OPT_CLR(options, QUIET); - return 0; } @@@ -3398,10 -3384,7 +3391,7 @@@ static void diffcore_skip_stat_unmatch( void diffcore_std(struct diff_options *options) { - if (DIFF_OPT_TST(options, QUIET)) - return; - - if (options->skip_stat_unmatch && !DIFF_OPT_TST(options, FIND_COPIES_HARDER)) + if (options->skip_stat_unmatch) diffcore_skip_stat_unmatch(options); if (options->break_opt != -1) diffcore_break(options->break_opt);