summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 297a1aa)
raw | patch | inline | side by side (parent: 297a1aa)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 10 Feb 2006 10:30:52 +0000 (02:30 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 10 Feb 2006 10:50:53 +0000 (02:50 -0800) |
This shows "new file mode XXXX" and "deleted file mode XXXX"
lines like two-way diff-patch output does, by checking the
status from each parent.
The diff-raw output for combined diff is made a bit uglier by
showing diff status letters with each parent. While most of the
case you would see "MM" in the output, an Evil Merge that
touches a path that was added by inheriting from one parent is
possible and it would be shown like these:
$ git-diff-tree --abbrev -c HEAD
2d7ca89675eb8888b0b88a91102f096d4471f09f
::000000 000000 100644 0000000... 0000000... 31dd686... AA b
::000000 100644 100644 0000000... 6c884ae... c6d4fa8... AM d
::100644 100644 100644 4f7cbe7... f8c295c... 19d5d80... RR e
Signed-off-by: Junio C Hamano <junkio@cox.net>
lines like two-way diff-patch output does, by checking the
status from each parent.
The diff-raw output for combined diff is made a bit uglier by
showing diff status letters with each parent. While most of the
case you would see "MM" in the output, an Evil Merge that
touches a path that was added by inheriting from one parent is
possible and it would be shown like these:
$ git-diff-tree --abbrev -c HEAD
2d7ca89675eb8888b0b88a91102f096d4471f09f
::000000 000000 100644 0000000... 0000000... 31dd686... AA b
::000000 100644 100644 0000000... 6c884ae... c6d4fa8... AM d
::100644 100644 100644 4f7cbe7... f8c295c... 19d5d80... RR e
Signed-off-by: Junio C Hamano <junkio@cox.net>
combine-diff.c | patch | blob | history | |
diff.h | patch | blob | history |
diff --git a/combine-diff.c b/combine-diff.c
index 8ba69492037f65d73ae73504d2c0062d41591434..a38f01b13ca6748ff7db613061a7715353832462 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
p->mode = q->queue[i]->two->mode;
memcpy(p->parent[n].sha1, q->queue[i]->one->sha1, 20);
p->parent[n].mode = q->queue[i]->one->mode;
+ p->parent[n].status = q->queue[i]->status;
*tail = p;
tail = &p->next;
}
memcpy(p->parent[n].sha1,
q->queue[i]->one->sha1, 20);
p->parent[n].mode = q->queue[i]->one->mode;
+ p->parent[n].status = q->queue[i]->status;
break;
}
}
printf("..%s\n", abb);
if (mode_differs) {
- printf("mode ");
- for (i = 0; i < num_parent; i++) {
- printf("%s%06o", i ? "," : "",
- elem->parent[i].mode);
+ int added = !!elem->mode;
+ for (i = 0; added && i < num_parent; i++)
+ if (elem->parent[i].status !=
+ DIFF_STATUS_ADDED)
+ added = 0;
+ if (added)
+ printf("new file mode %06o", elem->mode);
+ else {
+ if (!elem->mode)
+ printf("deleted file ");
+ printf("mode ");
+ for (i = 0; i < num_parent; i++) {
+ printf("%s%06o", i ? "," : "",
+ elem->parent[i].mode);
+ }
+ if (elem->mode)
+ printf("..%06o", elem->mode);
}
- printf("..%06o\n", elem->mode);
+ putchar('\n');
}
dump_sline(sline, cnt, num_parent);
}
@@ -811,8 +826,11 @@ static void show_raw_diff(struct combine_diff_path *p, int num_parent, const cha
}
if (opt->output_format == DIFF_FORMAT_RAW ||
- opt->output_format == DIFF_FORMAT_NAME_STATUS)
- printf("%c%c", mod_type, inter_name_termination);
+ opt->output_format == DIFF_FORMAT_NAME_STATUS) {
+ for (i = 0; i < num_parent; i++)
+ putchar(p->parent[i].status);
+ putchar(inter_name_termination);
+ }
if (line_termination) {
if (quote_c_style(p->path, NULL, NULL, 0))