{"thread":{"id":"25640","subject":"cherry-pick fail when a symbolic link has been changed into a file or directory","startedAt":"2010-11-04T11:56:41Z","lastAt":"2010-11-07T10:19:44Z","messageCount":10,"participants":["Camille Moncelier","Christian Couder","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"155162","messageId":"20101104125641.2ef90853@cortex","threadId":"25640","inReplyTo":null,"subject":"cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Camille Moncelier","fromEmail":"moncelier@devlife.org","sentAt":"2010-11-04T11:56:41Z","receivedAt":"2010-11-04T11:56:41Z","isPatch":false,"sender":{"key":"moncelier@devlife.org","avatar":"https://gravatar.com/avatar/4f9e2cf967b39917f6102c3c828bf5adbbf77b2662046a2a8a8c35bbbb58cbf1?d=mp&s=160"},"body":"I'm reposting this since I didn't get any responses and I think my\nmessage didn't contained enought context.\n\nI think I may have spotted a bug, or a unhandled case when doing a\ncherry-pick\n\nConsider a repository like this:\n\n# Initialize a dummy repository\n    mkdir -p repo1 ; cd repo1\n    git init .\n\n# Create a new directory `dir1' and a link to it `dir2'\n    mkdir dir1\n    echo file1 > dir1/file1\n    ln -s dir1 dir2\n    git add dir1 dir2\n    git commit -m \"Initial status: dir2 -> dir1\"\n\n# Create a branch named `test1' remove the `dir2' link and\n# replace it by a new directory\n    git checkout -b test1\n    git rm dir2\n    mkdir dir2\n    touch file2 > dir2/file1\n    git add dir2/file1\n    git commit -m \"Removing link: dir1/ and dir2/\"\n\n# Now create a new file in `test1' branch\n    message=\"New file in test1\"\n    echo $message > new_file_test1\n    git add new_file_test1\n    git commit -m \"$message\"\n\n# Now try to cherry-pick last commit from `test1' into master\n    git co master\n    git cherry-pick test1\n\nThe cherry-pick fails saying if failed to merge `dir2' despite the fact\nthat the commit doesn't affect `dir2' and \n\ngit diff test1~..test1 | git apply\n\nis working. Am I doing something wrong ?\n\n-- \nCamille Moncelier\nhttp://devlife.org\n"},{"id":"155164","messageId":"AANLkTimq8SP-gxZQiXW3Pxg3-1Z98zyPAoNA8JDn0=6A@mail.gmail.com","threadId":"25640","inReplyTo":"20101104125641.2ef90853@cortex","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2010-11-04T13:55:12Z","receivedAt":"2010-11-04T13:55:12Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Could you try to cherry-pick with other strategies?\nFor example with:\n\ngit cherry-pick --strategy resolve test1\n\nI remember there were some problems with the default \"recursive\"\nstrategy and I am not sure they were fixed.\nBy the way could you tell which version of git you are using?\n\nThanks,\nChristian.\n\nOn Thu, Nov 4, 2010 at 12:56 PM, Camille Moncelier\n<moncelier@devlife.org> wrote:\n> I'm reposting this since I didn't get any responses and I think my\n> message didn't contained enought context.\n>\n> I think I may have spotted a bug, or a unhandled case when doing a\n> cherry-pick\n>\n> Consider a repository like this:\n>\n> # Initialize a dummy repository\n>    mkdir -p repo1 ; cd repo1\n>    git init .\n>\n> # Create a new directory `dir1' and a link to it `dir2'\n>    mkdir dir1\n>    echo file1 > dir1/file1\n>    ln -s dir1 dir2\n>    git add dir1 dir2\n>    git commit -m \"Initial status: dir2 -> dir1\"\n>\n> # Create a branch named `test1' remove the `dir2' link and\n> # replace it by a new directory\n>    git checkout -b test1\n>    git rm dir2\n>    mkdir dir2\n>    touch file2 > dir2/file1\n>    git add dir2/file1\n>    git commit -m \"Removing link: dir1/ and dir2/\"\n>\n> # Now create a new file in `test1' branch\n>    message=\"New file in test1\"\n>    echo $message > new_file_test1\n>    git add new_file_test1\n>    git commit -m \"$message\"\n>\n> # Now try to cherry-pick last commit from `test1' into master\n>    git co master\n>    git cherry-pick test1\n>\n> The cherry-pick fails saying if failed to merge `dir2' despite the fact\n> that the commit doesn't affect `dir2' and\n>\n> git diff test1~..test1 | git apply\n>\n> is working. Am I doing something wrong ?\n>\n> --\n> Camille Moncelier\n> http://devlife.org\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"155166","messageId":"AANLkTinSxO+UOmY-34wd6ubkc4FffJaxcMWJOKitmGj0@mail.gmail.com","threadId":"25640","inReplyTo":"AANLkTimq8SP-gxZQiXW3Pxg3-1Z98zyPAoNA8JDn0=6A@mail.gmail.com","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2010-11-04T13:58:03Z","receivedAt":"2010-11-04T13:58:03Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Nov 4, 2010 at 2:55 PM, Christian Couder\n<christian.couder@gmail.com> wrote:\n> Could you try to cherry-pick with other strategies?\n> For example with:\n>\n> git cherry-pick --strategy resolve test1\n>\n> I remember there were some problems with the default \"recursive\"\n> strategy and I am not sure they were fixed.\n> By the way could you tell which version of git you are using?\n\nPS: Sorry for top-posting. Please don't answer like I just did.\n\n> On Thu, Nov 4, 2010 at 12:56 PM, Camille Moncelier\n> <moncelier@devlife.org> wrote:\n>> I'm reposting this since I didn't get any responses and I think my\n>> message didn't contained enought context.\n>>\n>> I think I may have spotted a bug, or a unhandled case when doing a\n>> cherry-pick\n>>\n>> Consider a repository like this:\n>>\n>> # Initialize a dummy repository\n>>    mkdir -p repo1 ; cd repo1\n>>    git init .\n>>\n>> # Create a new directory `dir1' and a link to it `dir2'\n>>    mkdir dir1\n>>    echo file1 > dir1/file1\n>>    ln -s dir1 dir2\n>>    git add dir1 dir2\n>>    git commit -m \"Initial status: dir2 -> dir1\"\n>>\n>> # Create a branch named `test1' remove the `dir2' link and\n>> # replace it by a new directory\n>>    git checkout -b test1\n>>    git rm dir2\n>>    mkdir dir2\n>>    touch file2 > dir2/file1\n>>    git add dir2/file1\n>>    git commit -m \"Removing link: dir1/ and dir2/\"\n>>\n>> # Now create a new file in `test1' branch\n>>    message=\"New file in test1\"\n>>    echo $message > new_file_test1\n>>    git add new_file_test1\n>>    git commit -m \"$message\"\n>>\n>> # Now try to cherry-pick last commit from `test1' into master\n>>    git co master\n>>    git cherry-pick test1\n>>\n>> The cherry-pick fails saying if failed to merge `dir2' despite the fact\n>> that the commit doesn't affect `dir2' and\n>>\n>> git diff test1~..test1 | git apply\n>>\n>> is working. Am I doing something wrong ?\n>>\n>> --\n>> Camille Moncelier\n>> http://devlife.org\n>>\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>\n>\n"},{"id":"155167","messageId":"20101104151637.076ac021@cortex","threadId":"25640","inReplyTo":"AANLkTimq8SP-gxZQiXW3Pxg3-1Z98zyPAoNA8JDn0=6A@mail.gmail.com","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Camille Moncelier","fromEmail":"moncelier@devlife.org","sentAt":"2010-11-04T14:16:37Z","receivedAt":"2010-11-04T14:16:37Z","isPatch":false,"sender":{"key":"moncelier@devlife.org","avatar":"https://gravatar.com/avatar/4f9e2cf967b39917f6102c3c828bf5adbbf77b2662046a2a8a8c35bbbb58cbf1?d=mp&s=160"},"body":"On Thu, 4 Nov 2010 14:55:12 +0100\nChristian Couder <christian.couder@gmail.com> wrote:\n\n> Could you try to cherry-pick with other strategies?\n> For example with:\n> \n> git cherry-pick --strategy resolve test1\n\n~/repo1$ git --version\ngit version 1.7.3.1\n\n~/repo1$ git cherry-pick --strategy resolve test1\nTrying simple merge.\nSimple merge failed, trying Automatic merge.\n[master da2d5bf] New file in test1\n 1 files changed, 1 insertions(+), \n create mode 100644 new_file_test1\n\nSeems it is working using the resolve strategy. I may have found a\nmessage on this list posted a while ago:\n\n\"cherry-picking a commit clobbers a file which is a directory in the\ntarget commit\"\n\nWhich seems to deal with the same kind of problems maybe something is\nmissing in the patch in order to handle this particular case.\n\n> I remember there were some problems with the default \"recursive\"\n> strategy and I am not sure they were fixed.\n> By the way could you tell which version of git you are using?\n\nI'm using ubuntu's 1.7.1 version on my laptop which doesn't support\n--strategy and a v1.7.3.1 on another computer, both expose the same\nproblem.\n\n> \n> Thanks,\n> Christian.\n\n--\nCamille Moncelier\nhttp://devlife.org\n"},{"id":"155176","messageId":"AANLkTi=cydcB2yRpWbSH7qZGHdjXEPjNvfBCJny7JcwJ@mail.gmail.com","threadId":"25640","inReplyTo":"20101104151637.076ac021@cortex","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2010-11-04T17:03:39Z","receivedAt":"2010-11-04T17:03:39Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Nov 4, 2010 at 3:16 PM, Camille Moncelier <moncelier@devlife.org> wrote:\n> On Thu, 4 Nov 2010 14:55:12 +0100\n> Christian Couder <christian.couder@gmail.com> wrote:\n>\n>> Could you try to cherry-pick with other strategies?\n>> For example with:\n>>\n>> git cherry-pick --strategy resolve test1\n>\n> ~/repo1$ git --version\n> git version 1.7.3.1\n>\n> ~/repo1$ git cherry-pick --strategy resolve test1\n> Trying simple merge.\n> Simple merge failed, trying Automatic merge.\n> [master da2d5bf] New file in test1\n>  1 files changed, 1 insertions(+),\n>  create mode 100644 new_file_test1\n>\n> Seems it is working using the resolve strategy. I may have found a\n> message on this list posted a while ago:\n>\n> \"cherry-picking a commit clobbers a file which is a directory in the\n> target commit\"\n>\n> Which seems to deal with the same kind of problems maybe something is\n> missing in the patch in order to handle this particular case.\n\nPlease reply not only to me but also to the list and add relevant\npeople in Cc: like I did.\n\nElijah Newren sent a patch series around September the 20th but I did\nnot check to see if this series was merged into pu, next or master.\nAnd I don't know if it fixes your problem.\nCould you have a look?\n\nThanks,\nChristian.\n"},{"id":"155179","messageId":"20101104181537.5f866d42@cortex","threadId":"25640","inReplyTo":"AANLkTi=cydcB2yRpWbSH7qZGHdjXEPjNvfBCJny7JcwJ@mail.gmail.com","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Camille Moncelier","fromEmail":"moncelier@devlife.org","sentAt":"2010-11-04T17:15:37Z","receivedAt":"2010-11-04T17:15:37Z","isPatch":false,"sender":{"key":"moncelier@devlife.org","avatar":"https://gravatar.com/avatar/4f9e2cf967b39917f6102c3c828bf5adbbf77b2662046a2a8a8c35bbbb58cbf1?d=mp&s=160"},"body":"On Thu, 4 Nov 2010 18:03:39 +0100\nChristian Couder <christian.couder@gmail.com> wrote:\n\n> Please reply not only to me but also to the list and add relevant\n> people in Cc: like I did.\nIt replied to the list[1] and CC'ed you. I use claws mail + gmane NNTP\ngateway. Maybe I did something wrong but it seems that the message has\nbeen successfully delivered to the list.\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/160722 \n> \n> Elijah Newren sent a patch series around September the 20th but I did\n> not check to see if this series was merged into pu, next or master.\n> And I don't know if it fixes your problem.\n> Could you have a look?\nI think I already took a look last week, and I think they were merged\nin 1.7.1 or 1.7.2 although I'm not sure. I'll take another look. This\nevening or maybe tomorrow.\n\n> \n> Thanks,\n> Christian.\n"},{"id":"155248","messageId":"AANLkTi=b4tV-PGwW9D+zBLpRtnJY6FZTH6S-Ee1J4gYq@mail.gmail.com","threadId":"25640","inReplyTo":"20101104181537.5f866d42@cortex","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2010-11-05T08:33:28Z","receivedAt":"2010-11-05T08:33:28Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Nov 4, 2010 at 6:15 PM, Camille Moncelier <moncelier@devlife.org> wrote:\n> On Thu, 4 Nov 2010 18:03:39 +0100\n> Christian Couder <christian.couder@gmail.com> wrote:\n>\n>> Please reply not only to me but also to the list and add relevant\n>> people in Cc: like I did.\n> It replied to the list[1] and CC'ed you. I use claws mail + gmane NNTP\n> gateway. Maybe I did something wrong but it seems that the message has\n> been successfully delivered to the list.\n>\n> [1] http://article.gmane.org/gmane.comp.version-control.git/160722\n\nYeah, sorry, I use gmail and I don't know why but it doesn't show the\nlist in \"To:\" or \"Cc:\".\n\nRegards,\nChristian.\n"},{"id":"155249","messageId":"AANLkTi=aGHvQhG3bOcqS-U04UjFeB7PVw9GTsSuf3UFA@mail.gmail.com","threadId":"25640","inReplyTo":"AANLkTimDWM69qvY5wdyzFu=g6htg12-K542PRR4bdDYq@mail.gmail.com","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2010-11-05T08:34:46Z","receivedAt":"2010-11-05T08:34:46Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Fri, Nov 5, 2010 at 5:54 AM, Elijah Newren <newren@gmail.com> wrote:\n> Hi,\n>\n> Sorry, I've been missing in action for about a month, but I'll have\n> some time this weekend to catch back up on git stuff...\n>\n> On Thu, Nov 4, 2010 at 11:15 AM, Camille Moncelier\n> <moncelier@devlife.org> wrote:\n>> On Thu, 4 Nov 2010 18:03:39 +0100\n>> Christian Couder <christian.couder@gmail.com> wrote:\n>>> Elijah Newren sent a patch series around September the 20th but I did\n>>> not check to see if this series was merged into pu, next or master.\n>>> And I don't know if it fixes your problem.\n>>> Could you have a look?\n>> I think I already took a look last week, and I think they were merged\n>> in 1.7.1 or 1.7.2 although I'm not sure. I'll take another look. This\n>> evening or maybe tomorrow.\n\nGreat!\n\n> The patch series I posted in late September post-dates the related\n> series of mine that were merged in 1.7.3.\n>\n> I'd also be happy to take a look and see if my newer merge-recursive\n> series fixes your case (or whether one of my other improvements to\n> that series since my September posting does).  If not, I'll track it\n> down and fix it and add that fix to the series.\n\nGreat!\n\nThanks both,\nChristian.\n"},{"id":"155316","messageId":"20101107104209.3e497c5b@cortex","threadId":"25640","inReplyTo":"AANLkTi=aGHvQhG3bOcqS-U04UjFeB7PVw9GTsSuf3UFA@mail.gmail.com","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Camille Moncelier","fromEmail":"moncelier@devlife.org","sentAt":"2010-11-07T09:42:09Z","receivedAt":"2010-11-07T09:42:09Z","isPatch":false,"sender":{"key":"moncelier@devlife.org","avatar":"https://gravatar.com/avatar/4f9e2cf967b39917f6102c3c828bf5adbbf77b2662046a2a8a8c35bbbb58cbf1?d=mp&s=160"},"body":"> > The patch series I posted in late September post-dates the related\n> > series of mine that were merged in 1.7.3.\n> >\n> > I'd also be happy to take a look and see if my newer merge-recursive\n> > series fixes your case (or whether one of my other improvements to\n> > that series since my September posting does).  If not, I'll track it\n> > down and fix it and add that fix to the series.\n> \nIt's strange I've just tested on my laptop and it seems fixed in\nv1.7.3. I'll redo the test this week on the repository I've first\nexperienced the problem, just to see if the problem is really gone or \nmy testcase isn't sufficient.\n\nI've tried to use git bisect to check the patch which fixed the problem\nbut, I didn't succeed. \n\nBTW, Is there a way using git bisect to find the \"last bad commit\",\nor maybe the \"first good one\" ?\n\n> Great!\n> \n> Thanks both,\n> Christian.\n"},{"id":"155318","messageId":"m239rdv3jz.fsf@igel.home","threadId":"25640","inReplyTo":"20101107104209.3e497c5b@cortex","subject":"Re: cherry-pick fail when a symbolic link has been changed into a file or directory","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-11-07T10:19:44Z","receivedAt":"2010-11-07T10:19:44Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Camille Moncelier <moncelier@devlife.org> writes:\n\n> BTW, Is there a way using git bisect to find the \"last bad commit\",\n> or maybe the \"first good one\" ?\n\nIt works the same as \"find first bad one\", you just have to exchange\n\"good\" and \"bad\" (they really mean \"before\" and \"after\").\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}