subtree: improve decision on merges kept in split
[gitweb.git] / log-tree.c
index f482f47b83dc3e2a999e00c93ac089fc6de5a6b9..7a83e99250c5245bbbbd43908f3c116567f39b62 100644 (file)
@@ -16,6 +16,7 @@
 #include "line-log.h"
 #include "help.h"
 #include "interdiff.h"
+#include "range-diff.h"
 
 static struct decoration name_decoration = { "object names" };
 static int decoration_loaded;
@@ -473,7 +474,7 @@ static int which_parent(const struct object_id *oid, const struct commit *commit
        const struct commit_list *parent;
 
        for (nth = 0, parent = commit->parents; parent; parent = parent->next) {
-               if (!oidcmp(&parent->item->object.oid, oid))
+               if (oideq(&parent->item->object.oid, oid))
                        return nth;
                nth++;
        }
@@ -507,8 +508,8 @@ static int show_one_mergetag(struct commit *commit,
        if (parse_tag_buffer(the_repository, tag, extra->value, extra->len))
                strbuf_addstr(&verify_message, "malformed mergetag\n");
        else if (is_common_merge(commit) &&
-                !oidcmp(&tag->tagged->oid,
-                         &commit->parents->next->item->object.oid))
+                oideq(&tag->tagged->oid,
+                      &commit->parents->next->item->object.oid))
                strbuf_addf(&verify_message,
                            "merged tag '%s'\n", tag->tag);
        else if ((nth = which_parent(&tag->tagged->oid, commit)) < 0)
@@ -751,6 +752,20 @@ void show_log(struct rev_info *opt)
 
                memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff));
        }
+
+       if (cmit_fmt_is_mail(ctx.fmt) && opt->rdiff1) {
+               struct diff_queue_struct dq;
+
+               memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff));
+               DIFF_QUEUE_CLEAR(&diff_queued_diff);
+
+               next_commentary_block(opt, NULL);
+               fprintf_ln(opt->diffopt.file, "%s", opt->rdiff_title);
+               show_range_diff(opt->rdiff1, opt->rdiff2,
+                               opt->creation_factor, 1, &opt->diffopt);
+
+               memcpy(&diff_queued_diff, &dq, sizeof(diff_queued_diff));
+       }
 }
 
 int log_tree_diff_flush(struct rev_info *opt)