summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a4b5e91)
raw | patch | inline | side by side (parent: a4b5e91)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Sun, 21 Mar 2010 00:37:33 +0000 (19:37 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 21 Mar 2010 03:36:11 +0000 (20:36 -0700) |
git merge-file --diff3 can be used to present conflicts hunks
including text from the common ancestor.
The added information is helpful for resolving a merge by hand, and
merge tools can usually grok it because it looks like output from
diff3 -m. However, ‘diff3’ includes a label for the merge base on the
||||||| line and some tools cannot parse conflict hunks without such a
label. Write the base-name as passed in a -L option (or the name of
the ancestor file by default) on that line.
git rerere will not have trouble parsing this output, since instead of
looking for a newline, it looks for whitespace after the |||||||
marker. Since rerere includes its own code for recreating conflict
hunks, conflict identifiers are unaffected. No other code in git tries
to parse conflict hunks.
Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
including text from the common ancestor.
The added information is helpful for resolving a merge by hand, and
merge tools can usually grok it because it looks like output from
diff3 -m. However, ‘diff3’ includes a label for the merge base on the
||||||| line and some tools cannot parse conflict hunks without such a
label. Write the base-name as passed in a -L option (or the name of
the ancestor file by default) on that line.
git rerere will not have trouble parsing this output, since instead of
looking for a newline, it looks for whitespace after the |||||||
marker. Since rerere includes its own code for recreating conflict
hunks, conflict identifiers are unaffected. No other code in git tries
to parse conflict hunks.
Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge-file.c | patch | blob | history | |
t/t6023-merge-file.sh | patch | blob | history |
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index 65eb790fd0ac0cf5c7c267aacd521a632ac73a0c..610849a6533c6fd2d3d2e8d3f8d233757174aabd 100644 (file)
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
argv[i]);
}
+ xmp.ancestor = names[1];
xmp.file1 = names[0];
xmp.file2 = names[2];
ret = xdl_merge(mmfs + 1, mmfs + 0, mmfs + 2, &xmp, &result);
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index 5034dd1352c275beca4d5dae805cad6573a89aca..d486d73994cf563063b578ec5e212331e87bf67f 100755 (executable)
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
In loco pascuae ibi me collocavit;
super aquam refectionis educavit me.
-|||||||
+||||||| new5.txt
et nihil mihi deerit.
In loco pascuae ibi me collocavit,
super aquam refectionis educavit me;
In loco pascuae ibi me collocavit;
super aquam refectionis educavit me.
-||||||||||
+|||||||||| new5.txt
et nihil mihi deerit.
In loco pascuae ibi me collocavit,
super aquam refectionis educavit me;