{"thread":{"id":"14442","subject":"[PATCH] Fix reduce_heads","startedAt":"2008-07-14T04:07:41Z","lastAt":"2008-07-14T11:57:25Z","messageCount":4,"participants":["Sverre Hvammen Johansen","Johannes Schindelin","Miklos Vajna"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"83212","messageId":"402c10cd0807132107s29c470f7hb834bd5c00ef399e@mail.gmail.com","threadId":"14442","inReplyTo":null,"subject":"[PATCH] Fix reduce_heads","fromName":"Sverre Hvammen Johansen","fromEmail":"hvammen@gmail.com","sentAt":"2008-07-14T04:07:41Z","receivedAt":"2008-07-14T04:07:41Z","isPatch":true,"sender":{"key":"hvammen@gmail.com","avatar":"https://gravatar.com/avatar/d1fc25ec327eea135af60fe7b56b2a2e21f711aa32167e7f505014ec88aa24bc?d=mp&s=160"},"body":"Reduce_heads used by build in merge failed to find the correct\nheads in cases where duplicate heads are specified.\n---\nThis should fix the last breakage I found. ([PATCH/Test] Build in\nmerge is broken)\nI have squashed in Miklos's fix and the two tests cases to protect this.\n\nI have several other test cases that were used for the --ff-only patch\nI worked on.\nMany of the cases for that patch gives protection not currently in any of the\nexisting tests.  If there is interest for it I can squash them in as well.\n\n commit.c         |    8 +++++++-\n t/t7600-merge.sh |   22 ++++++++++++++++++++++\n 2 files changed, 29 insertions(+), 1 deletions(-)\n\ndiff --git a/commit.c b/commit.c\nindex d20b14e..4cacf4c 100644\n--- a/commit.c\n+++ b/commit.c\n@@ -746,8 +746,14 @@ struct commit_list *reduce_heads(struct commit_list *heads)\n                struct commit_list *q, *base;\n\n                num_other = 0;\n+               for (q = heads; q != p; q = q->next) {\n+                       if (p->item == q->item)\n+                               break;\n+               }\n+               if (q != p)\n+                       continue;\n                for (q = heads; q; q = q->next) {\n-                       if (p == q)\n+                       if (p->item == q->item)\n                                continue;\n                        other[num_other++] = q->item;\n                }\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 16f4608..80cfee6 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -465,4 +465,26 @@ test_expect_success 'merge log message' '\n\n test_debug 'gitk --all'\n\n+test_expect_success 'merge c1 with c0, c2, c0, and c1' '\n+       git reset --hard c1 &&\n+       git config branch.master.mergeoptions \"\" &&\n+       test_tick &&\n+       git merge c0 c2 c0 c1 &&\n+       verify_merge file result.1-5 &&\n+       verify_parents $c1 $c2\n+'\n+\n+test_debug 'gitk --all'\n+\n+test_expect_success 'merge c1 with c1 and c2' '\n+       git reset --hard c1 &&\n+       git config branch.master.mergeoptions \"\" &&\n+       test_tick &&\n+       git merge c1 c2 &&\n+       verify_merge file result.1-5 &&\n+       verify_parents $c1 $c2\n+'\n+\n+test_debug 'gitk --all'\n+\n test_done\n-- \nSverre Hvammen Johansen\n"},{"id":"83245","messageId":"alpine.LSU.1.00.0807141128240.3486@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"14442","inReplyTo":"402c10cd0807132107s29c470f7hb834bd5c00ef399e@mail.gmail.com","subject":"Re: [PATCH] Fix reduce_heads","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-14T09:30:24Z","receivedAt":"2008-07-14T09:30:24Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 13 Jul 2008, Sverre Hvammen Johansen wrote:\n\n> Reduce_heads used by build in merge failed to find the correct\n> heads in cases where duplicate heads are specified.\n\nI liked Junio's explanation better.\n\n> This should fix the last breakage I found. ([PATCH/Test] Build in\n> merge is broken)\n> I have squashed in Miklos's fix and the two tests cases to protect this.\n\nI'd rather not have it squashed in.  Miklos is a GSoC student, and at the \nend I want to show the shortlog to tell Google how he fared.\n\nUnfortunately, Miklos is on holiday this week, so he cannot send a mail of \nhis own.  Junio, could you fake a commit message with a sign-off for \nMiklos, or do you want me to do it?\n\nCiao,\nDscho\n"},{"id":"83248","messageId":"20080714114453.GL10347@genesis.frugalware.org","threadId":"14442","inReplyTo":"alpine.LSU.1.00.0807141128240.3486@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Fix reduce_heads","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-07-14T11:44:53Z","receivedAt":"2008-07-14T11:44:53Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Mon, Jul 14, 2008 at 11:30:24AM +0200, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Unfortunately, Miklos is on holiday this week, so he cannot send a mail of \n> his own.  Junio, could you fake a commit message with a sign-off for \n> Miklos, or do you want me to do it?\n\nI'll go out tomorrow, so I can send that it today. Sorry for not sending\na proper patch for the first time. ;-)\n"},{"id":"83252","messageId":"20080714115725.GM10347@genesis.frugalware.org","threadId":"14442","inReplyTo":"20080714114453.GL10347@genesis.frugalware.org","subject":"Re: [PATCH] Fix reduce_heads","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-07-14T11:57:25Z","receivedAt":"2008-07-14T11:57:25Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Mon, Jul 14, 2008 at 01:44:53PM +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:\n> I'll go out tomorrow, so I can send that it today. Sorry for not sending\n> a proper patch for the first time. ;-)\n\nAh, It's already in 'pu', so never mind.\n"}]}