From: Junio C Hamano Date: Thu, 26 Oct 2006 09:07:18 +0000 (-0700) Subject: Merge branch 'jc/combined' X-Git-Tag: v1.4.4-rc1~63 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/af70fa4f48fdb12fef49c8bf2abc507f80081bf3?ds=inline;hp=-c Merge branch 'jc/combined' * jc/combined: combine-diff: honour --no-commit-id combine-diff: fix hunk_comment_line logic. --- af70fa4f48fdb12fef49c8bf2abc507f80081bf3 diff --combined combine-diff.c index 466156fb4d,8bf99f215c..29d0c9cf95 --- a/combine-diff.c +++ b/combine-diff.c @@@ -491,7 -491,11 +491,11 @@@ static void show_parent_lno(struct slin static int hunk_comment_line(const char *bol) { - int ch = *bol & 0xff; + int ch; + + if (!bol) + return 0; + ch = *bol & 0xff; return (isalpha(ch) || ch == '_' || ch == '$'); } @@@ -737,7 -741,7 +741,7 @@@ static void show_patch_diff(struct comb int added = 0; int deleted = 0; - if (rev->loginfo) + if (rev->loginfo && !rev->no_commit_id) show_log(rev, opt->msg_sep); dump_quoted_path(dense ? "diff --cc " : "diff --combined ", elem->path, c_meta, c_reset); @@@ -815,7 -819,7 +819,7 @@@ static void show_raw_diff(struct combin if (!line_termination) inter_name_termination = 0; - if (rev->loginfo) + if (rev->loginfo && !rev->no_commit_id) show_log(rev, opt->msg_sep); if (opt->output_format & DIFF_FORMAT_RAW) { @@@ -887,17 -891,15 +891,17 @@@ void diff_tree_combined(const unsigned diffopts.output_format = DIFF_FORMAT_NO_OUTPUT; diffopts.recursive = 1; - show_log_first = !!rev->loginfo; + show_log_first = !!rev->loginfo && !rev->no_commit_id; needsep = 0; /* find set of paths that everybody touches */ for (i = 0; i < num_parent; i++) { /* show stat against the first parent even * when doing combined diff. */ - if (i == 0 && opt->output_format & DIFF_FORMAT_DIFFSTAT) - diffopts.output_format = DIFF_FORMAT_DIFFSTAT; + int stat_opt = (opt->output_format & + (DIFF_FORMAT_NUMSTAT|DIFF_FORMAT_DIFFSTAT)); + if (i == 0 && stat_opt) + diffopts.output_format = stat_opt; else diffopts.output_format = DIFF_FORMAT_NO_OUTPUT; diff_tree_sha1(parent[i], sha1, "", &diffopts); @@@ -927,8 -929,7 +931,8 @@@ } needsep = 1; } - else if (opt->output_format & DIFF_FORMAT_DIFFSTAT) + else if (opt->output_format & + (DIFF_FORMAT_NUMSTAT|DIFF_FORMAT_DIFFSTAT)) needsep = 1; if (opt->output_format & DIFF_FORMAT_PATCH) { if (needsep)