{"thread":{"id":"5185","subject":"[PATCH] merge-recur: if there is no common ancestor, fake empty one","startedAt":"2006-08-09T16:43:03Z","lastAt":"2006-08-09T19:55:11Z","messageCount":3,"participants":["Johannes Schindelin","Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"25033","messageId":"Pine.LNX.4.63.0608091842210.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5185","inReplyTo":null,"subject":"[PATCH] merge-recur: if there is no common ancestor, fake empty one","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-09T16:43:03Z","receivedAt":"2006-08-09T16:43:03Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThis fixes the coolest merge ever.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\n---\n\n\tThis was a forgotten part from the python version.\n\n merge-recursive.c |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 7a93dd9..f5b547b 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1223,6 +1223,18 @@ int merge(struct commit *h1,\n \t\toutput_commit_title(iter->item);\n \n \tmerged_common_ancestors = pop_commit(&ca);\n+\tif (merged_common_ancestors == NULL) {\n+\t\t/* if there is no common ancestor, make an empty tree */\n+\t\tstruct tree *tree = xcalloc(1, sizeof(struct tree));\n+\t\tchar buffer[40];\n+\t\tint hdrlen;\n+\n+\t\ttree->object.parsed = 1;\n+\t\ttree->object.type = OBJ_TREE;\n+\t\t*write_sha1_file_prepare(NULL, 0, tree_type, &tree->object.sha1,\n+\t\t\t\tbuffer, &hdrlen);\n+\t\tmerged_common_ancestors = make_virtual_commit(tree, \"ancestor\");\n+\t}\n \n \tfor (iter = ca; iter; iter = iter->next) {\n \t\toutput_indent = call_depth + 1;\n-- \n1.4.2.rc3.g29d0-dirty\n"},{"id":"25037","messageId":"Pine.LNX.4.63.0608091943570.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5185","inReplyTo":"Pine.LNX.4.63.0608091842210.1800@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] merge-recur: if there is no common ancestor, fake empty one","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-09T17:44:38Z","receivedAt":"2006-08-09T17:44:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Aug 2006, Johannes Schindelin wrote:\n\n> +\t\t*write_sha1_file_prepare(NULL, 0, tree_type, &tree->object.sha1,\n\n... make this \"tree->object.sha1\" _without_ a \"&\", of course.\n\nCiao,\nDscho\n"},{"id":"25046","messageId":"20060809195511.GA13766@steel.home","threadId":"5185","inReplyTo":"Pine.LNX.4.63.0608091943570.1800@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] merge-recur: if there is no common ancestor, fake empty one","fromName":"Alex Riesen","fromEmail":"fork0@t-online.de","sentAt":"2006-08-09T19:55:11Z","receivedAt":"2006-08-09T19:55:11Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Johannes Schindelin, Wed, Aug 09, 2006 19:44:38 +0200:\n> \n> > +\t\t*write_sha1_file_prepare(NULL, 0, tree_type, &tree->object.sha1,\n> \n> ... make this \"tree->object.sha1\" _without_ a \"&\", of course.\n> \n\nAnd without the asterisk before write_sha1_file_prepare\n"}]}