summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-03 01:43:47 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-03 01:53:26 (GMT)
commitf7a3d33f0f93eba4db61819b289df76a32d61b1b (patch)
treee3dd9df323411fb872574c7ac9797cc8c0736b38
parent46dc941246af6e845eb7835afdb8cd20eed835b7 (diff)
downloadgit-f7a3d33f0f93eba4db61819b289df76a32d61b1b.zip
git-f7a3d33f0f93eba4db61819b289df76a32d61b1b.tar.gz
git-f7a3d33f0f93eba4db61819b289df76a32d61b1b.tar.bz2
combine-diff: finishing touches to git-diff-tree --cc
This updates the output format to make administrative lines more consistent with the traditional diffs. The "index" line shows blob object names from each parents (separated by commas), double dots and the object name of the resulting blob. The hunk header line begins with N+1 '@' characters for N-way diff, the line number L of the first line in the hunk and line count C from the parent in "-L,C" format for each parents and then the line number of the first line in the hunk and line count from the resulting file in "+L,C" format, and finally N+1 '@' characters (earlier versions had the line numbers from the resulting file at the beginning). Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--combine-diff.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 216a77e..210ffcb 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -528,7 +528,7 @@ static void show_parent_lno(struct sline *sline, unsigned long l0, unsigned long
{
l0 = sline[l0].p_lno[n];
l1 = sline[l1].p_lno[n];
- printf("-%lu,%lu ", l0, l1-l0);
+ printf(" -%lu,%lu", l0, l1-l0);
}
static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent)
@@ -548,9 +548,9 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent)
if (!(sline[hunk_end].flag & mark))
break;
for (i = 0; i <= num_parent; i++) putchar(combine_marker);
- printf(" +%lu,%lu ", lno+1, hunk_end-lno);
for (i = 0; i < num_parent; i++)
show_parent_lno(sline, lno, hunk_end, cnt, i);
+ printf(" +%lu,%lu ", lno+1, hunk_end-lno);
for (i = 0; i <= num_parent; i++) putchar(combine_marker);
putchar('\n');
while (lno < hunk_end) {
@@ -714,11 +714,11 @@ int show_combined_diff(struct combine_diff_path *elem, int num_parent,
printf("index ");
for (i = 0; i < num_parent; i++) {
printf("%s%s",
- i ? ".." : "",
+ i ? "," : "",
find_unique_abbrev(elem->parent_sha1[i],
DEFAULT_ABBREV));
}
- printf("->%s\n",
+ printf("..%s\n",
find_unique_abbrev(elem->sha1, DEFAULT_ABBREV));
dump_sline(sline, cnt, num_parent);
}