{"thread":{"id":"22613","subject":"Re: git-subtree.sh - regression introduced by da949cc55","startedAt":"2010-02-11T13:08:37Z","lastAt":"2010-02-13T19:49:18Z","messageCount":5,"participants":["Jakub Suder","Marc Fournier","Avery Pennarun"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"134222","messageId":"20100211130837.GA29916@lonquimay.wrk.lsn.camptocamp.com","threadId":"22613","inReplyTo":null,"subject":"git-subtree.sh - regression introduced by da949cc55","fromName":"Marc Fournier","fromEmail":"marc.fournier@camptocamp.com","sentAt":"2010-02-11T13:08:37Z","receivedAt":"2010-02-11T13:08:37Z","isPatch":false,"sender":{"key":"marc.fournier@camptocamp.com","avatar":null},"body":"Hello,\n\nUp to this commit, I was able to split out new trees out of sub-directories\nof my project.\n\nI used this to create a subproject out of a directory, without necessarily\nknowing in advance that I could need the content of this directory in other\nprojects.\n\nSince da949cc55, older unrelated commits get prepended to the history.\n\nThis issue is quite easy to reproduce:\n\n 1. choose a directory in your project which hasn't been added with\n    \"git subtree add\". Let's say it's called my/directory/.\n 2. \"git subtree split --prefix=my/directory --branch the-new-tree\"\n 3. \"git log --stat the-new-tree\"\n 4. notice the mess which happens at the first commit concerning\n    my/directory/ and how it then includes random older commits which have\n    nothing related to my/directory.\n\nJakub, I'm not sure I understand what this patch is supposed to fix. Could\nyou provide an example ? Or a test case ?\n\nThanks !\nMarc\n"},{"id":"134221","messageId":"508e1531002110526u623bffbdi119d009a7af460b8@mail.gmail.com","threadId":"22613","inReplyTo":"20100211130837.GA29916@lonquimay.wrk.lsn.camptocamp.com","subject":"Re: git-subtree.sh - regression introduced by da949cc55","fromName":"Jakub Suder","fromEmail":"jakub.suder@gmail.com","sentAt":"2010-02-11T13:26:23Z","receivedAt":"2010-02-11T13:26:23Z","isPatch":false,"sender":{"key":"jakub.suder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/28465?v=4"},"body":"On Thu, Feb 11, 2010 at 14:08, Marc Fournier\n<marc.fournier@camptocamp.com> wrote:\n> Jakub, I'm not sure I understand what this patch is supposed to fix. Could\n> you provide an example ? Or a test case ?\n\nHi,\n\nthere is a test case for the change you're talking about - it's near\nthe end of test.sh, between \"check if split can find proper base\nwithout --onto\" and \"check_equal ...\" (it was added a few commits\nlater). The problem was that without this commit, in some cases if I\ncalled subtree split for an external project which was earlier added\nwith git subtree (in order to backport some changes to the original\nproject) it didn't create the new commits on top of the existing ones\nlike it should (just look at the test case).\n\nI'll take a closer look at this in the evening...\n\nJakub Suder\n"},{"id":"134366","messageId":"32541b131002120952gcb5116as730fff8bdcf005c1@mail.gmail.com","threadId":"22613","inReplyTo":"508e1531002110526u623bffbdi119d009a7af460b8@mail.gmail.com","subject":"Re: git-subtree.sh - regression introduced by da949cc55","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-02-12T17:52:22Z","receivedAt":"2010-02-12T17:52:22Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Thu, Feb 11, 2010 at 8:26 AM, Jakub Suder <jakub.suder@gmail.com> wrote:\n> On Thu, Feb 11, 2010 at 14:08, Marc Fournier\n> <marc.fournier@camptocamp.com> wrote:\n>> Jakub, I'm not sure I understand what this patch is supposed to fix. Could\n>> you provide an example ? Or a test case ?\n>\n> there is a test case for the change you're talking about - it's near\n> the end of test.sh, between \"check if split can find proper base\n> without --onto\" and \"check_equal ...\" (it was added a few commits\n> later). The problem was that without this commit, in some cases if I\n> called subtree split for an external project which was earlier added\n> with git subtree (in order to backport some changes to the original\n> project) it didn't create the new commits on top of the existing ones\n> like it should (just look at the test case).\n>\n> I'll take a closer look at this in the evening...\n\nDid you have a chance to look at this?\n\nAvery\n"},{"id":"134457","messageId":"508e1531002131141o32fdc555keb31a3d8b05d7109@mail.gmail.com","threadId":"22613","inReplyTo":"32541b131002120952gcb5116as730fff8bdcf005c1@mail.gmail.com","subject":"Re: git-subtree.sh - regression introduced by da949cc55","fromName":"Jakub Suder","fromEmail":"jakub.suder@gmail.com","sentAt":"2010-02-13T19:41:08Z","receivedAt":"2010-02-13T19:41:08Z","isPatch":false,"sender":{"key":"jakub.suder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/28465?v=4"},"body":"On Fri, Feb 12, 2010 at 18:52, Avery Pennarun <apenwarr@gmail.com> wrote:\n> Did you have a chance to look at this?\n\nIt's true, when you try to extract a subproject from an ordinary\ndirectory of a project, using git subtree split, it builds the new\nbranch on top of some past commit, instead of as a completely separate\ntimeline, and it's exactly because of my change. The problem lies in\nwhat you wrote in the comment above that fragment: \"ugly.  is there no\nbetter way to tell if this is a subtree vs. a mainline commit?  Does\nit matter?\" - well, apparently it does matter :) That line fixed my\nproblem, because commits in the subproject's timeline should have\ncache set to themselves, but it the case when you start from the other\nside (first subtree split, not first subtree add), in this fragment\nthe first commits from the mainline (which are unrelated to the\nsubdirectory) are regarded as subtree commits, because $tree is empty\n(but not because the root directory is different, only because it just\ndidn't exist yet at this point).\n\nWe just need some different way of determining if this is a commit\nfrom subtree timeline or the main timeline - I'll see if I can come up\nwith something...\n\nJS\n"},{"id":"134458","messageId":"32541b131002131149v27df5655mf400fc8c39834856@mail.gmail.com","threadId":"22613","inReplyTo":"508e1531002131141o32fdc555keb31a3d8b05d7109@mail.gmail.com","subject":"Re: git-subtree.sh - regression introduced by da949cc55","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-02-13T19:49:18Z","receivedAt":"2010-02-13T19:49:18Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Sat, Feb 13, 2010 at 2:41 PM, Jakub Suder <jakub.suder@gmail.com> wrote:\n> We just need some different way of determining if this is a commit\n> from subtree timeline or the main timeline - I'll see if I can come up\n> with something...\n\nGreat, thanks.  By the way, the fact that the unit tests didn't catch\nthis is a bit worrisome, so if you could take a look at that at the\nsame time it would be great.\n\n(BTW, I just merged a patch from someone to add the long-awaited \"git\nsubtree push\" and 2-argument \"git subtree add\" commands.  So I'm not\n*totally* useless. :))\n\nHave fun,\n\nAvery\n"}]}