summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d685654)
raw | patch | inline | side by side (parent: d685654)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Sun, 21 Mar 2010 00:46:07 +0000 (19:46 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 21 Mar 2010 03:36:11 +0000 (20:36 -0700) |
When writing conflict hunks in ‘diff3 -m’ format, also add a label to
the common ancestor. Especially in a cherry-pick, it is not immediately
obvious without such a label what the common ancestor represents.
git rerere does not have trouble parsing the new output and its preimage
ids are unchanged since it includes its own code for recreating conflict
hunks. No other code in git parses 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>
the common ancestor. Especially in a cherry-pick, it is not immediately
obvious without such a label what the common ancestor represents.
git rerere does not have trouble parsing the new output and its preimage
ids are unchanged since it includes its own code for recreating conflict
hunks. No other code in git parses 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/revert.c | patch | blob | history | |
t/t3507-cherry-pick-conflict.sh | patch | blob | history |
diff --git a/builtin/revert.c b/builtin/revert.c
index 5a5b72112c132440888e2f88c4ae0162c7b1078f..1ddfac15b55a1b0bed7c7e359cb952749225a4f2 100644 (file)
--- a/builtin/revert.c
+++ b/builtin/revert.c
{
unsigned char head[20];
struct commit *base, *next, *parent;
- const char *next_label;
+ const char *base_label, *next_label;
int i, index_fd, clean;
struct commit_message msg = { NULL, NULL, NULL, NULL, NULL };
if (action == REVERT) {
base = commit;
+ base_label = msg.label;
next = parent;
next_label = msg.parent_label;
add_to_msg("Revert \"");
add_to_msg(".\n");
} else {
base = parent;
+ base_label = msg.parent_label;
next = commit;
next_label = msg.label;
set_author_ident_env(msg.message);
read_cache();
init_merge_options(&o);
+ o.ancestor = base ? base_label : "(empty tree)";
o.branch1 = "HEAD";
o.branch2 = next ? next_label : "(empty tree)";
index 6a208173779f744f6b350ee12dd710be157ace6e..e25cf8039a310e325c23e85ce5fc845a0f681200 100644 (file)
cat <<-EOF > expected &&
<<<<<<< HEAD
a
- |||||||
+ ||||||| parent of objid picked
b
=======
c
cat <<-EOF > expected &&
<<<<<<< HEAD
a
- |||||||
+ ||||||| objid picked
c
=======
b