{"thread":{"id":"42112","subject":"Subtree Split Includes Commits Outside Prefix Directory","startedAt":"2016-04-22T18:38:35Z","lastAt":"2016-08-30T05:12:51Z","messageCount":4,"participants":["ELI","David A. Greene"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"284165","messageId":"CAKU2X8bAXmVfJz9P7d3k-_d12sjyrzWt+kJCGj8V6fTDAjsFog@mail.gmail.com","threadId":"42112","inReplyTo":null,"subject":"Subtree Split Includes Commits Outside Prefix Directory","fromName":"ELI","fromEmail":"eliptus@gmail.com","sentAt":"2016-04-22T18:38:35Z","receivedAt":"2016-04-22T18:38:35Z","isPatch":false,"sender":{"key":"eliptus@gmail.com","avatar":null},"body":"I attempt a subtree push to a sub-project which I knew not to have had\nany local modification since the last subtree push it had received,\nbut it failed.\n\nTo subproject\n ! [rejected]        5a9ad640651d3d54387afa5b7eaf89ed0b392a01 ->\nmaster (non-fast-forward)\nerror: failed to push some refs to 'subproject'\nhint: Updates were rejected because a pushed branch tip is behind its remote\nhint: counterpart. Check out this branch and integrate the remote changes\nhint: (e.g. 'git pull ...') before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details.\n\n\nThe first step I took to understand the cause was to do a subtree\nsplit and inspect the commit history of the resulting branch.  I found\nthat it contained commits that did not touch any files in the\nsubproject.  Doing a git show on these commits revealed that they were\nnot empty commits, but contained diff information for paths in the\nmain project, and in some cases, other subprojects that exist in the\nmain project.\n\n\nI then reviewed the commit history of contrib/subtree/git-subtree.sh\nand determined that the last successful subtree push was performed\nprior to the integration of this change:\nhttps://git.kernel.org/cgit/git/git.git/commit/contrib/subtree/git-subtree.sh?id=933cfeb90b5d03b4096db6d60494a6eedea25d03\n\nAs a next step, I reversed that patch on my local install of git\nsubtree, and the result was a successful subtree push.\n\n\nUnfortunately, I have not yet reproduced this with a test main project\nand subprojects, and I cannot make the project I observed it in\npublic.\n\n\n- Harpreet \"Eli\" Sangha\n"},{"id":"287161","messageId":"87eg8vovsj.fsf@waller.obbligato.org","threadId":"42112","inReplyTo":"CAKU2X8bAXmVfJz9P7d3k-_d12sjyrzWt+kJCGj8V6fTDAjsFog@mail.gmail.com","subject":"Re: Subtree Split Includes Commits Outside Prefix Directory","fromName":"David A. Greene","fromEmail":"greened@obbligato.org","sentAt":"2016-05-21T23:06:52Z","receivedAt":"2016-05-21T23:06:52Z","isPatch":false,"sender":{"key":"greened@obbligato.org","avatar":"https://avatars.githubusercontent.com/u/5291869?v=4"},"body":"ELI <eliptus@gmail.com> writes:\n\n> I then reviewed the commit history of contrib/subtree/git-subtree.sh\n> and determined that the last successful subtree push was performed\n> prior to the integration of this change:\n> https://git.kernel.org/cgit/git/git.git/commit/contrib/subtree/git-subtree.sh?id=933cfeb90b5d03b4096db6d60494a6eedea25d03\n>\n> As a next step, I reversed that patch on my local install of git\n> subtree, and the result was a successful subtree push.\n\nSo you're saying that this patch caused a regression?\n\n> Unfortunately, I have not yet reproduced this with a test main project\n> and subprojects, and I cannot make the project I observed it in\n> public.\n\nI very much want to see a testcase for this.  I'm planning to\nfundamentally rewrite the split code this year and want to make sure it\ncovers everything it does now and fixes a few bugs that have been\nexposed lately.\n\nIt's tough to revert that patch since it fixed a problem for someone and\nwe don't have a testcase demonstrating the problem you encountered.  Not\nsaying your problem isn't important but we need to understand it and\nhave a way to flag it before fixing or hiding it with a revert of the\nabove patch.\n\n                       -David\n"},{"id":"290009","messageId":"CAKU2X8ZqRgXpqV+97VYUW9o7ZHxgo5dKURYB3k_21FGpj0dUng@mail.gmail.com","threadId":"42112","inReplyTo":"CAKU2X8ZTf6_ptGkD4na+j5MPeD=yCKUTpK6VT2Ye87Ffs_KdrA@mail.gmail.com","subject":"Re: Subtree Split Includes Commits Outside Prefix Directory","fromName":"ELI","fromEmail":"eliptus@gmail.com","sentAt":"2016-06-24T02:32:36Z","receivedAt":"2016-06-24T02:33:01Z","isPatch":false,"sender":{"key":"eliptus@gmail.com","avatar":null},"body":"Attempting to resend without HTML...\n\n- Harpreet \"Eli\" Sangha\n\n\nOn Thu, Jun 23, 2016 at 7:18 PM, ELI <eliptus@gmail.com> wrote:\n> Sorry for the delayed response... your email somehow found it's way into my\n> Gmail spam folder.\n>\n> I've created a simple reproduction case and hosted the test repositories on\n> BitBucket for sharing:\n> https://bitbucket.org/eliptus/subtree-test-sup\n> https://bitbucket.org/eliptus/subtree-test-suba\n> https://bitbucket.org/eliptus/subtree-test-subb\n> https://bitbucket.org/eliptus/subtree-test-subc\n>\n> Quick Repro Step:\n> git -C Sup subtree push --prefix=c SubC working\n>\n> You can reproduce the behavior I describe previously with the test\n> repositories by simply attempting a subtree push from Sup to SubC.  The\n> result is that SubC contains commit history for changes make exclusively to\n> SubA and SubB.  Below are details of how I got to this state.\n>\n> Test Setup:\n>\n> Created four new git repositories with initial commits: Sup, SubA, SubB,\n> SubC\n>\n> The branch \"working\" in repository SubC still reflects the state after this\n> step.\n>\n> Performed \"subtree add\" for SubA, SubB, and SubC into Sup with prefixes a,\n> b, and c, respectively.\n> Added additional commits directly in repositories SubA and SubB.\n>\n> The branch \"master\" in repositories SubA and SubB still reflect the state\n> after this step.\n>\n> Performed \"subtree pull\" from SubA and SubB to Sup.\n> Added a commit in repository Sup that modifies prefix \"c\".\n>\n> The branch \"master\" in repository Sup still reflects the state after this\n> step.\n>\n> Performed \"subtree push\" to SubC from Sup.\n>\n> The branch \"master\" in repository SubC still reflects the state after this\n> step.\n> A \"git log --patch master\" in repository SubC shows commit's made in SubA\n> and SubB.\n>\n>\n> Regards,\n>\n> On Sat, May 21, 2016 at 4:06 PM David A. Greene <greened@obbligato.org>\n> wrote:\n>>\n>> ELI <eliptus@gmail.com> writes:\n>>\n>> > I then reviewed the commit history of contrib/subtree/git-subtree.sh\n>> > and determined that the last successful subtree push was performed\n>> > prior to the integration of this change:\n>> >\n>> > https://git.kernel.org/cgit/git/git.git/commit/contrib/subtree/git-subtree.sh?id=933cfeb90b5d03b4096db6d60494a6eedea25d03\n>> >\n>> > As a next step, I reversed that patch on my local install of git\n>> > subtree, and the result was a successful subtree push.\n>>\n>> So you're saying that this patch caused a regression?\n>>\n>> > Unfortunately, I have not yet reproduced this with a test main project\n>> > and subprojects, and I cannot make the project I observed it in\n>> > public.\n>>\n>> I very much want to see a testcase for this.  I'm planning to\n>> fundamentally rewrite the split code this year and want to make sure it\n>> covers everything it does now and fixes a few bugs that have been\n>> exposed lately.\n>>\n>> It's tough to revert that patch since it fixed a problem for someone and\n>> we don't have a testcase demonstrating the problem you encountered.  Not\n>> saying your problem isn't important but we need to understand it and\n>> have a way to flag it before fixing or hiding it with a revert of the\n>> above patch.\n>>\n>>                        -David\n>\n> --\n> - Harpreet \"Eli\" Sangha\n"},{"id":"300531","messageId":"CAKU2X8a8n3kr+K-Jk9_-mxE_GtjzsHMkPY86=JjWeWseT8ecXg@mail.gmail.com","threadId":"42112","inReplyTo":"CAKU2X8ZqRgXpqV+97VYUW9o7ZHxgo5dKURYB3k_21FGpj0dUng@mail.gmail.com","subject":"Re: Subtree Split Includes Commits Outside Prefix Directory","fromName":"ELI","fromEmail":"eliptus@gmail.com","sentAt":"2016-08-30T05:12:19Z","receivedAt":"2016-08-30T05:12:51Z","isPatch":false,"sender":{"key":"eliptus@gmail.com","avatar":null},"body":"Hey David,\n\nDid this give you the repro case that you needed?\n- Harpreet \"Eli\" Sangha\n\n\nOn Thu, Jun 23, 2016 at 7:32 PM, ELI <eliptus@gmail.com> wrote:\n> Attempting to resend without HTML...\n>\n> - Harpreet \"Eli\" Sangha\n>\n>\n> On Thu, Jun 23, 2016 at 7:18 PM, ELI <eliptus@gmail.com> wrote:\n>> Sorry for the delayed response... your email somehow found it's way into my\n>> Gmail spam folder.\n>>\n>> I've created a simple reproduction case and hosted the test repositories on\n>> BitBucket for sharing:\n>> https://bitbucket.org/eliptus/subtree-test-sup\n>> https://bitbucket.org/eliptus/subtree-test-suba\n>> https://bitbucket.org/eliptus/subtree-test-subb\n>> https://bitbucket.org/eliptus/subtree-test-subc\n>>\n>> Quick Repro Step:\n>> git -C Sup subtree push --prefix=c SubC working\n>>\n>> You can reproduce the behavior I describe previously with the test\n>> repositories by simply attempting a subtree push from Sup to SubC.  The\n>> result is that SubC contains commit history for changes make exclusively to\n>> SubA and SubB.  Below are details of how I got to this state.\n>>\n>> Test Setup:\n>>\n>> Created four new git repositories with initial commits: Sup, SubA, SubB,\n>> SubC\n>>\n>> The branch \"working\" in repository SubC still reflects the state after this\n>> step.\n>>\n>> Performed \"subtree add\" for SubA, SubB, and SubC into Sup with prefixes a,\n>> b, and c, respectively.\n>> Added additional commits directly in repositories SubA and SubB.\n>>\n>> The branch \"master\" in repositories SubA and SubB still reflect the state\n>> after this step.\n>>\n>> Performed \"subtree pull\" from SubA and SubB to Sup.\n>> Added a commit in repository Sup that modifies prefix \"c\".\n>>\n>> The branch \"master\" in repository Sup still reflects the state after this\n>> step.\n>>\n>> Performed \"subtree push\" to SubC from Sup.\n>>\n>> The branch \"master\" in repository SubC still reflects the state after this\n>> step.\n>> A \"git log --patch master\" in repository SubC shows commit's made in SubA\n>> and SubB.\n>>\n>>\n>> Regards,\n>>\n>> On Sat, May 21, 2016 at 4:06 PM David A. Greene <greened@obbligato.org>\n>> wrote:\n>>>\n>>> ELI <eliptus@gmail.com> writes:\n>>>\n>>> > I then reviewed the commit history of contrib/subtree/git-subtree.sh\n>>> > and determined that the last successful subtree push was performed\n>>> > prior to the integration of this change:\n>>> >\n>>> > https://git.kernel.org/cgit/git/git.git/commit/contrib/subtree/git-subtree.sh?id=933cfeb90b5d03b4096db6d60494a6eedea25d03\n>>> >\n>>> > As a next step, I reversed that patch on my local install of git\n>>> > subtree, and the result was a successful subtree push.\n>>>\n>>> So you're saying that this patch caused a regression?\n>>>\n>>> > Unfortunately, I have not yet reproduced this with a test main project\n>>> > and subprojects, and I cannot make the project I observed it in\n>>> > public.\n>>>\n>>> I very much want to see a testcase for this.  I'm planning to\n>>> fundamentally rewrite the split code this year and want to make sure it\n>>> covers everything it does now and fixes a few bugs that have been\n>>> exposed lately.\n>>>\n>>> It's tough to revert that patch since it fixed a problem for someone and\n>>> we don't have a testcase demonstrating the problem you encountered.  Not\n>>> saying your problem isn't important but we need to understand it and\n>>> have a way to flag it before fixing or hiding it with a revert of the\n>>> above patch.\n>>>\n>>>                        -David\n>>\n>> --\n>> - Harpreet \"Eli\" Sangha\n"}]}