{"thread":{"id":"56646","subject":"Git push subtree fail unknown revision or path possibly due to missing git-subtree-split commit","startedAt":"2021-10-05T04:54:01Z","lastAt":"2021-10-08T01:14:40Z","messageCount":4,"participants":["Eddie Ridwan","Philippe Blain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"437954","messageId":"CANcBuaZstymNMvbPX553kgr=FsrFFcDEivfiDPsPe3uyGLb78g@mail.gmail.com","threadId":"56646","inReplyTo":null,"subject":"Git push subtree fail unknown revision or path possibly due to missing git-subtree-split commit","fromName":"Eddie Ridwan","fromEmail":"eddie.ridwan@gmail.com","sentAt":"2021-10-05T04:53:47Z","receivedAt":"2021-10-05T04:54:01Z","isPatch":false,"sender":{"key":"eddie.ridwan@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\ngit pull/push subtree as normal, although it is possible that one of\nthe contributors to the subtree repo may have done a force push.\n\nWhat did you expect to happen? (Expected behavior)\ngit push subtree to update the remote subtree repo.\n\nWhat happened instead? (Actual behavior)\nFailed to update the remote subtree repo. Error message:\n\n       fatal: ambiguous argument\n'3f44cc87ceb87df1d9171096596a824fc3050a27^{commit}': unknown revision\nor path not in the working tree.\n    Use '--' to separate paths from revisions, like this:\n    'git <command> [<revision>...] -- [<file>...]'\n    could not rev-parse split hash\n3f44cc87ceb87df1d9171096596a824fc3050a27 from commit\n8577911bf6183497cc246aa620e7be1b6becec29\n\nWhat's different between what you expected and what actually happened?\n\nFailed to update the subtree repo, as expected;\n\nAnything else you want to add:\n\nI am not able to find the commit/hash\n3f44cc87ceb87df1d9171096596a824fc3050a27 in the repo. In gitx, I can\nsee that the commit is a git-subtree-split. But it appears to no\nlonger exist in the repo.\n\nHow can I bypass or recover from this apparent missing commit? Any\nhelp would be greatly appreciated.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.33.0\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 22 19:49:55\nPDT 2021; root:xnu-6153.141.35~1/RELEASE_X86_64 x86_64\ncompiler info: clang: 12.0.0 (clang-1200.0.32.29)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n"},{"id":"438112","messageId":"61ee8bec-1e6c-e3c7-2cef-7520f376c18c@gmail.com","threadId":"56646","inReplyTo":"CANcBuaZstymNMvbPX553kgr=FsrFFcDEivfiDPsPe3uyGLb78g@mail.gmail.com","subject":"Re: Git push subtree fail unknown revision or path possibly due to missing git-subtree-split commit","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2021-10-07T02:52:27Z","receivedAt":"2021-10-07T02:52:33Z","isPatch":false,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Eddie,\n\nLe 2021-10-05 à 00:53, Eddie Ridwan a écrit :\n> Thank you for filling out a Git bug report!\n> Please answer the following questions to help us understand your issue.\n> \n> What did you do before the bug happened? (Steps to reproduce your issue)\n> git pull/push subtree as normal, although it is possible that one of\n> the contributors to the subtree repo may have done a force push.\n\nI think that is indeed what happened (see below).\n\n> \n> What did you expect to happen? (Expected behavior)\n> git push subtree to update the remote subtree repo.\n> \n> What happened instead? (Actual behavior)\n> Failed to update the remote subtree repo. Error message:\n> \n>         fatal: ambiguous argument\n> '3f44cc87ceb87df1d9171096596a824fc3050a27^{commit}': unknown revision\n> or path not in the working tree.\n>      Use '--' to separate paths from revisions, like this:\n>      'git <command> [<revision>...] -- [<file>...]'\n>      could not rev-parse split hash\n> 3f44cc87ceb87df1d9171096596a824fc3050a27 from commit\n> 8577911bf6183497cc246aa620e7be1b6becec29\n\nIt would be easier to help you if you gave a URL for your repository :)\n(or at least for the subtree). I managed to find you Stack Overflow\npost [1] by Googling these commit hashes (!). Fortunately you mention\nthe subtree URL in your question, and that's enough to go by in this case.\n\n> \n> What's different between what you expected and what actually happened?\n> \n> Failed to update the subtree repo, as expected;\n> \n> Anything else you want to add:\n> \n> I am not able to find the commit/hash\n> 3f44cc87ceb87df1d9171096596a824fc3050a27 in the repo. In gitx, I can\n> see that the commit is a git-subtree-split. But it appears to no\n> longer exist in the repo.\n\nHere, I'm assuming that by \"in the repo\" you mean in a clone of the subtree\nrepo, i.e. a clone of https://github.com/OpenSID/tema-natra.\n\nIndeed the commit with hash 3f44cc87ceb87df1d9171096596a824fc3050a27 does not exist in\nsuch a clone. But, it still exists on GitHub:\n\nhttps://github.com/OpenSID/tema-natra/commit/3f44cc87ceb87df1d9171096596a824fc3050a27\n\nGitHub almost never removes commits in practice. This is good news, because\nit means you can fetch it locally.\n\n> How can I bypass or recover from this apparent missing commit? Any\n> help would be greatly appreciated.\n\nThe git-subtree script does need the commit locally to work. So, just fetch\nthe commit by its hash. In your project repository (the one which uses tema-natra as\na subtree), run:\n\ngit fetch https://github.com/OpenSID/tema-natra.git 3f44cc87ceb87df1d9171096596a824fc3050a27\n\nThis will download the needed objects. After that, you *should* be able to\nrun your 'git subtree push' command.\n\nNote: I think that the 'premium' branch (mentioned in your Stack Overflow question)\nwas indeed force-pushed, since 'git log --oneline dadcd0167^..' does not show the two\ncommits that appear in your image [2] that read \"Update statistik_pengunjung.php\"\n\nHope that helps,\n\nPhilippe.\n\n[1] https://stackoverflow.com/questions/69431546/git-push-subtree-fail-unknown-revision-or-path-possibly-due-to-missing-git-subtr\n[2] https://i.stack.imgur.com/1tMln.jpg\n"},{"id":"438121","messageId":"CANcBuabe3px0N=awsuBGxdHgU8ChGHJdG8PAPoMJGnG98ntjdA@mail.gmail.com","threadId":"56646","inReplyTo":"61ee8bec-1e6c-e3c7-2cef-7520f376c18c@gmail.com","subject":"Re: Git push subtree fail unknown revision or path possibly due to missing git-subtree-split commit","fromName":"Eddie Ridwan","fromEmail":"eddie.ridwan@gmail.com","sentAt":"2021-10-07T05:43:49Z","receivedAt":"2021-10-07T05:44:03Z","isPatch":false,"sender":{"key":"eddie.ridwan@gmail.com","avatar":null},"body":"Hi Philippe\n\nMany thanks for your help, and thanks for the tip regarding including\nthe subtree URL in the question. Your suggestion worked in that the\n'missing' commit is now in my local clone. And now the git push\nsubtree does not generate any error.\n\nUnfortunately it did not update the remote subtree repo. This is the\nonly output of the push command:\n\ngit subtree push --prefix themes/natra\nhttps://github.com/OpenSID/tema-natra.git premium\ngit push using:  https://github.com/OpenSID/tema-natra.git premium\n1/     131 (436) [436]\n\nOn the other hand, git pull subtree continues to work as expected.\n\nAny suggestions on how to find out why the git push subtree command\ndid not update the remote repo?\n\nMany thanks.\n\nEddie Ridwan\n\nOn Thu, 7 Oct 2021 at 13:52, Philippe Blain\n<levraiphilippeblain@gmail.com> wrote:\n>\n> Hi Eddie,\n>\n> Le 2021-10-05 à 00:53, Eddie Ridwan a écrit :\n> > Thank you for filling out a Git bug report!\n> > Please answer the following questions to help us understand your issue.\n> >\n> > What did you do before the bug happened? (Steps to reproduce your issue)\n> > git pull/push subtree as normal, although it is possible that one of\n> > the contributors to the subtree repo may have done a force push.\n>\n> I think that is indeed what happened (see below).\n>\n> >\n> > What did you expect to happen? (Expected behavior)\n> > git push subtree to update the remote subtree repo.\n> >\n> > What happened instead? (Actual behavior)\n> > Failed to update the remote subtree repo. Error message:\n> >\n> >         fatal: ambiguous argument\n> > '3f44cc87ceb87df1d9171096596a824fc3050a27^{commit}': unknown revision\n> > or path not in the working tree.\n> >      Use '--' to separate paths from revisions, like this:\n> >      'git <command> [<revision>...] -- [<file>...]'\n> >      could not rev-parse split hash\n> > 3f44cc87ceb87df1d9171096596a824fc3050a27 from commit\n> > 8577911bf6183497cc246aa620e7be1b6becec29\n>\n> It would be easier to help you if you gave a URL for your repository :)\n> (or at least for the subtree). I managed to find you Stack Overflow\n> post [1] by Googling these commit hashes (!). Fortunately you mention\n> the subtree URL in your question, and that's enough to go by in this case.\n>\n> >\n> > What's different between what you expected and what actually happened?\n> >\n> > Failed to update the subtree repo, as expected;\n> >\n> > Anything else you want to add:\n> >\n> > I am not able to find the commit/hash\n> > 3f44cc87ceb87df1d9171096596a824fc3050a27 in the repo. In gitx, I can\n> > see that the commit is a git-subtree-split. But it appears to no\n> > longer exist in the repo.\n>\n> Here, I'm assuming that by \"in the repo\" you mean in a clone of the subtree\n> repo, i.e. a clone of https://github.com/OpenSID/tema-natra.\n>\n> Indeed the commit with hash 3f44cc87ceb87df1d9171096596a824fc3050a27 does not exist in\n> such a clone. But, it still exists on GitHub:\n>\n> https://github.com/OpenSID/tema-natra/commit/3f44cc87ceb87df1d9171096596a824fc3050a27\n>\n> GitHub almost never removes commits in practice. This is good news, because\n> it means you can fetch it locally.\n>\n> > How can I bypass or recover from this apparent missing commit? Any\n> > help would be greatly appreciated.\n>\n> The git-subtree script does need the commit locally to work. So, just fetch\n> the commit by its hash. In your project repository (the one which uses tema-natra as\n> a subtree), run:\n>\n> git fetch https://github.com/OpenSID/tema-natra.git 3f44cc87ceb87df1d9171096596a824fc3050a27\n>\n> This will download the needed objects. After that, you *should* be able to\n> run your 'git subtree push' command.\n>\n> Note: I think that the 'premium' branch (mentioned in your Stack Overflow question)\n> was indeed force-pushed, since 'git log --oneline dadcd0167^..' does not show the two\n> commits that appear in your image [2] that read \"Update statistik_pengunjung.php\"\n>\n> Hope that helps,\n>\n> Philippe.\n>\n> [1] https://stackoverflow.com/questions/69431546/git-push-subtree-fail-unknown-revision-or-path-possibly-due-to-missing-git-subtr\n> [2] https://i.stack.imgur.com/1tMln.jpg\n"},{"id":"438250","messageId":"efdf8b7e-b568-cb13-eb07-346dc9ca4f49@gmail.com","threadId":"56646","inReplyTo":"CANcBuaZmRj3tZqprNwjJatJ87F0vUVDKDRm5+OnOk_z3wqvJYg@mail.gmail.com","subject":"Re: Git push subtree fail unknown revision or path possibly due to missing git-subtree-split commit","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2021-10-08T01:14:36Z","receivedAt":"2021-10-08T01:14:40Z","isPatch":false,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Eddie\n\n[we reply inline on this mailing list, see below :)]\n\nLe 2021-10-07 à 02:00, Eddie Ridwan a écrit :\n> Hi Philippe\n> \n> Using the debug option (see attached file), I see that the git push\n> subtree command is complaining that many commits are in the wrong\n> order.\n> \n\nIndeed, the attachment shows many messages like:\n\nprogress: 1/     131 (0) [0]\nProcessing commit: 1fbbdda4f0ef15794eeb4a343d3fb1bf17fbb853\n   parents: c75f7cab156c91a1bf3b36658e1ac94dd1905bba\n     incorrect order: c75f7cab156c91a1bf3b36658e1ac94dd1905bba\n\n\n> Any idea how this could happen? And is there any way to recover from this?\n\nI'm not a 'git subtree' user myself, so really don't know unfortunately.\n\n> \n> Would it be best to just delete the subtree and start again?\n\nYou could do that. If you do want to debug further, I would suggest\nsearching the mailing list (see https://lore.kernel.org/git/_/text/help/)\nfor recent contributors to 'contrib/subtree' and CC-ing them. Maybe they\nwill be able to provide more insight here.\n\nYou also asked on Stack Overflow if you should try to delete the subtree\ncache. I think this could be something to try (I would guess if it's called\na cache, it should be recreated). But again I'm not a 'git subtree' user.\n\n> \n> Many thanks\n> \n> Eddie Ridwan\n\nCheers,\n\nPhilippe.\n"}]}