{"thread":{"id":"17185","subject":"[RFC PATCH] Zooko's merge testcase","startedAt":"2009-01-15T00:53:38Z","lastAt":"2009-01-15T03:36:41Z","messageCount":2,"participants":["Miklos Vajna","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"100526","messageId":"1231980818-24812-1-git-send-email-vmiklos@frugalware.org","threadId":"17185","inReplyTo":null,"subject":"[RFC PATCH] Zooko's merge testcase","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-01-15T00:53:38Z","receivedAt":"2009-01-15T00:53:38Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nThe original page is here:\n\nhttps://zooko.com/badmerge/simple.html\n\nIIRC it was Robin who mentioned it on IRC.\n\nI obviously not send this patch for inclusion, but to raise a\ndiscussion: if I were a naive user I would think the merge will at least\nresult in a conflict, however actually it just gaves a wrong result.\n\n t/t7608-merge-zooko.sh |   88 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 88 insertions(+), 0 deletions(-)\n create mode 100755 t/t7608-merge-zooko.sh\n\ndiff --git a/t/t7608-merge-zooko.sh b/t/t7608-merge-zooko.sh\nnew file mode 100755\nindex 0000000..32609c0\n--- /dev/null\n+++ b/t/t7608-merge-zooko.sh\n@@ -0,0 +1,88 @@\n+#!/bin/sh\n+\n+test_description='git merge\n+\n+Testing merge with the examples of Zooko.'\n+\n+. ./test-lib.sh\n+\n+#\n+# A - D     \\\n+#   \\ B - C - E\n+#\n+test_expect_success 'setup' '\n+\tcat <<EOF >file &&\n+A\n+B\n+C\n+D\n+E\n+EOF\n+\tgit add file &&\n+\tgit commit -m A &&\n+\tgit tag A &&\n+\tcat <<EOF >file &&\n+G\n+G\n+G\n+A\n+B\n+C\n+D\n+E\n+EOF\n+\tgit add file &&\n+\tgit commit -m B &&\n+\tgit tag B &&\n+\tcat <<EOF >file &&\n+A\n+B\n+C\n+D\n+E\n+G\n+G\n+G\n+A\n+B\n+C\n+D\n+E\n+EOF\n+\tgit add file &&\n+\tgit commit -m C &&\n+\tgit tag C &&\n+\tgit reset --hard A &&\n+\tcat <<EOF >file &&\n+A\n+B\n+X\n+D\n+E\n+EOF\n+\tgit add file &&\n+\tgit commit -m D &&\n+\tgit tag D\n+'\n+\n+test_expect_failure 'merge C' '\n+\tcat <<EOF >expected &&\n+A\n+B\n+C\n+D\n+E\n+G\n+G\n+G\n+A\n+B\n+X\n+D\n+E\n+EOF\n+\tgit merge C &&\n+\ttest_cmp expected file\n+'\n+\n+test_done\n-- \n1.6.1\n"},{"id":"100539","messageId":"alpine.DEB.1.00.0901150432530.3586@pacific.mpi-cbg.de","threadId":"17185","inReplyTo":"1231980818-24812-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [RFC PATCH] Zooko's merge testcase","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-15T03:36:41Z","receivedAt":"2009-01-15T03:36:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 15 Jan 2009, Miklos Vajna wrote:\n\n> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n> ---\n\nI think the idea can be simplified.  Given lines A, B, C in the base \ncommit, one branch _prepending_ the same triplet, and the other branch \nchanging the B to a D.\n\nOnly this time, nobody has a chance, even Darcs, because from the diff, \nyou would not know if it was prepended or appended.\n\n(Which happens to be the same problem as 3-way merge has with the example \nyou were implementing; only when looking at the detailed history becomes \nit clear what was done.)\n\nThis all just proves again that there can be no perfect merge strategy; \nyou'll always have to verify that the right thing was done.\n\nCiao,\nDscho\n"}]}