{"thread":{"id":"47780","subject":"Bug report: Subtree split including extra commits","startedAt":"2018-02-07T14:51:44Z","lastAt":"2018-02-07T14:51:44Z","messageCount":1,"participants":["Daniel Karp"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"338628","messageId":"CAOv5hWewPHqy5KQVBthskx0Ww6cdvpAJrEgSti1Ai4uLxg94Cg@mail.gmail.com","threadId":"47780","inReplyTo":null,"subject":"Bug report: Subtree split including extra commits","fromName":"Daniel Karp","fromEmail":"danielkarp@gmail.com","sentAt":"2018-02-07T14:51:16Z","receivedAt":"2018-02-07T14:51:44Z","isPatch":false,"sender":{"key":"danielkarp@gmail.com","avatar":null},"body":"Apologies if this is the wrong place to send a bug report for\nContributed software.\n\nI've run into what seems like an issue/bug with git subtree.\n\nI am trying to split a single directory of our repo into its own repo\nusing git subtree. I ran the the following command from our project\nroot:\ngit subtree split --prefix=geekui2 -b geekui2-split\nwhere geekui2 is the name of the subdir.\n\nFor commits before mid 2017, the created split branch contains our\nentire commit history, regardless whether or not they include changes\nin geekui2. For commits after that point, the commits are properly\nfiltered to include only commits that contain changes in geekui2.\n\nThe upshot is that if I push the branch to a new repo, and check out\none of those earlier commits, I can essentially recover the entire\ncodebase of our application (at that point), not just the content in\ngeekui2. Since our goal was to share part of our repo while keeping\nthe rest of it private, this is obviously a problem.\n\nI've also tried using git-subrepo for this split--it seems to\ncorrectly filter the commits, excluding all commits without changes to\ngeekui2. So something seems to be going wrong with the way git-subtree\nhandles this relative to git subrepo.\n\nUnfortunately, there is a lot going on in our repo--I have no idea how\nI would generate a minimal reproduction of this.\n\nWhile our repo is private, I'm happy to help try to help debug this if\nsomeone wants to take a look at this issue, although it is not my area\nof expertise.\n\nMy git version is 2.16.1, and I am running it on macOS 10.12.6.\n\nI am not subscribed to the git mailing list, so if anyone wants to get\nin touch with me about this, I'm most likely to see it if you send an\nemail.\n\n--\nDaniel Karp\n"}]}