From: Junio C Hamano Date: Sat, 28 Jan 2006 08:16:09 +0000 (-0800) Subject: Merge lt/revlist,jc/diff,jc/revparse,jc/abbrev X-Git-Tag: v1.2.0~100 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=addafaf92eeb86033da91323d0d3ad7a496dae83;p=git.git Merge lt/revlist,jc/diff,jc/revparse,jc/abbrev --- addafaf92eeb86033da91323d0d3ad7a496dae83 diff --cc diff-tree.c index efa2b947,efa2b947,99c580cf,efa2b947,44bc2381..6593a692 --- a/diff-tree.c +++ b/diff-tree.c @@@@@@ -79,12 -79,12 -82,16 -79,12 -80,12 +83,16 @@@@@@ static const char *generate_header(cons offset = sprintf(this_header, "%s%s ", header_prefix, diff_unique_abbrev(commit_sha1, abbrev)); -- -- offset += sprintf(this_header + offset, "(from %s)\n", -- -- parent_sha1 ? -- -- diff_unique_abbrev(parent_sha1, abbrev) : "root"); -- - offset += pretty_print_commit(commit_format, msg, len, ++ ++ if (commit_sha1 != parent_sha1) ++ ++ offset += sprintf(this_header + offset, "(from %s)\n", ++ ++ parent_sha1 ++ ++ ? diff_unique_abbrev(parent_sha1, abbrev) ++ ++ : "root"); ++ ++ else ++ ++ offset += sprintf(this_header + offset, "(from parents)\n"); - offset += pretty_print_commit(commit_format, msg, len, ++++ offset += pretty_print_commit(commit_format, commit, len, this_header + offset, ---- sizeof(this_header) - offset); ++++ sizeof(this_header) - offset, abbrev); return this_header; } @@@@@@ -108,8 -108,8 -115,17 -108,8 -109,8 +116,16 @@@@@@ static int diff_tree_commit(const unsig } /* More than one parent? */ -- -- if (ignore_merges && commit->parents && commit->parents->next) -- -- return 0; ++ ++ if (commit->parents && commit->parents->next) { ++ ++ if (ignore_merges) ++ ++ return 0; ++ ++ else if (combine_merges) { - header = generate_header(sha1, sha1, - commit->buffer); +++++ header = generate_header(sha1, sha1, commit); ++ ++ return diff_tree_combined_merge(sha1, header, ++ ++ show_empty_combined, ++ ++ dense_combined_merges); ++ ++ } ++ ++ } for (parents = commit->parents; parents; parents = parents->next) { struct commit *parent = parents->item;