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;
}
}
/* 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;