From: Junio C Hamano Date: Sun, 16 Nov 2008 08:48:59 +0000 (-0800) Subject: Merge branch 'jk/commit-v-strip' X-Git-Tag: v1.6.1-rc1~42 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=47a792539a48327e62c594f2befb5c5d1e58c0f2;p=git.git Merge branch 'jk/commit-v-strip' * jk/commit-v-strip: status: show "-v" diff even for initial commit wt-status: refactor initial commit printing define empty tree sha1 as a macro --- 47a792539a48327e62c594f2befb5c5d1e58c0f2 diff --cc wt-status.c index 6a7645ed8,ec91fba60..3edae43ce --- a/wt-status.c +++ b/wt-status.c @@@ -298,20 -279,12 +279,21 @@@ static void wt_status_print_verbose(str struct rev_info rev; init_revisions(&rev, NULL); - setup_revisions(0, NULL, &rev, s->reference); + setup_revisions(0, NULL, &rev, + s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference); rev.diffopt.output_format |= DIFF_FORMAT_PATCH; rev.diffopt.detect_rename = 1; + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); rev.diffopt.file = s->fp; rev.diffopt.close_file = 0; + /* + * If we're not going to stdout, then we definitely don't + * want color, since we are going to the commit message + * file (and even the "auto" setting won't work, since it + * will have checked isatty on stdout). + */ + if (s->fp != stdout) + DIFF_OPT_CLR(&rev.diffopt, COLOR_DIFF); run_diff_index(&rev, 1); }