{"thread":{"id":"21201","subject":"[PATCH] Aggressive three-way merge: fix D/F case","startedAt":"2009-10-12T02:53:47Z","lastAt":"2009-10-12T02:53:47Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"124655","messageId":"7vaazxnwzo.fsf@alter.siamese.dyndns.org","threadId":"21201","inReplyTo":null,"subject":"[PATCH] Aggressive three-way merge: fix D/F case","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-12T02:53:47Z","receivedAt":"2009-10-12T02:53:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"When the ancestor used to have a blob \"P\", your tree removed it, and the\ntree you are merging with also removed it, the agressive three-way cleanly\nmerges to remove that blob.  If the other tree added a new blob \"P/Q\"\nwhile removing \"P\", it should also merge cleanly to remove \"P\" and create\n\"P/Q\" (since neither the ancestor nor your tree could have had it, so it\nis a typical \"created in one\").\n\nThe \"aggressive\" rule is not new anymore.  Reword the stale comment.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * This fixes one problem in the 3-way merge with corrected tree/index\n   entry order the jc/fix-tree-walk topic exposes.\n\n t/t6035-merge-dir-to-symlink.sh |    2 +-\n unpack-trees.c                  |   13 ++++++++-----\n 2 files changed, 9 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6035-merge-dir-to-symlink.sh\nindex b9a280e..d1b2287 100755\n--- a/t/t6035-merge-dir-to-symlink.sh\n+++ b/t/t6035-merge-dir-to-symlink.sh\n@@ -74,7 +74,7 @@ test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '\n \tgit tag test2\n '\n \n-test_expect_failure 'merge should not have conflicts (resolve)' '\n+test_expect_success 'merge should not have conflicts (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s resolve test2 &&\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex c424bab..ec12341 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -767,7 +767,8 @@ int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o)\n \t\tremote = NULL;\n \t}\n \n-\t/* First, if there's a #16 situation, note that to prevent #13\n+\t/*\n+\t * First, if there's a #16 situation, note that to prevent #13\n \t * and #14.\n \t */\n \tif (!same(remote, head)) {\n@@ -781,7 +782,8 @@ int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o)\n \t\t}\n \t}\n \n-\t/* We start with cases where the index is allowed to match\n+\t/*\n+\t * We start with cases where the index is allowed to match\n \t * something other than the head: #14(ALT) and #2ALT, where it\n \t * is permitted to match the result instead.\n \t */\n@@ -811,12 +813,13 @@ int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o)\n \tif (!head && !remote && any_anc_missing)\n \t\treturn 0;\n \n-\t/* Under the new \"aggressive\" rule, we resolve mostly trivial\n+\t/*\n+\t * Under the \"aggressive\" rule, we resolve mostly trivial\n \t * cases that we historically had git-merge-one-file resolve.\n \t */\n \tif (o->aggressive) {\n-\t\tint head_deleted = !head && !df_conflict_head;\n-\t\tint remote_deleted = !remote && !df_conflict_remote;\n+\t\tint head_deleted = !head;\n+\t\tint remote_deleted = !remote;\n \t\tstruct cache_entry *ce = NULL;\n \n \t\tif (index)\n-- \n1.6.5.59.g7e3f2\n"}]}