{"thread":{"id":"42721","subject":"Git mv -- submodule -- recursive","startedAt":"2016-06-27T06:02:44Z","lastAt":"2016-06-27T21:20:30Z","messageCount":4,"participants":["Bart Bogaerts","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"290222","messageId":"CAOG-3GJdH5q9fdj+7zdEv-UUZMTAnunZu1PRJYjFNV360r6+sQ@mail.gmail.com","threadId":"42721","inReplyTo":null,"subject":"Git mv -- submodule -- recursive","fromName":"Bart Bogaerts","fromEmail":"bartbogaerts@gmail.com","sentAt":"2016-06-27T06:01:59Z","receivedAt":"2016-06-27T06:02:44Z","isPatch":false,"sender":{"key":"bartbogaerts@gmail.com","avatar":"https://gravatar.com/avatar/c85570cbecf4bbdc221a0e4470af017d3c77ce80e865e2d565304ead921a2698?d=mp&s=160"},"body":"With a repo structured as follows\n\nmain-files\n|- submod\n    |- subsubmodule\n\ngit mv submod newlocation\n\ndoes not do what it is supposed to do. It actually breaks the git repository.\nIt can be fixed easily.\nA complete description of the bug, including a workaround, can be found on\nhttp://stackoverflow.com/q/32782382/2274140\n\n-- \nBart Bogaerts\n"},{"id":"290256","messageId":"CAGZ79kYKBxL4xLyySALBv_-gqkss9_iCk-qSc4T7u7fKDMOFWw@mail.gmail.com","threadId":"42721","inReplyTo":"CAOG-3GJdH5q9fdj+7zdEv-UUZMTAnunZu1PRJYjFNV360r6+sQ@mail.gmail.com","subject":"Re: Git mv -- submodule -- recursive","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-06-27T16:57:24Z","receivedAt":"2016-06-27T16:57:34Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Sun, Jun 26, 2016 at 11:01 PM, Bart Bogaerts <bartbogaerts@gmail.com> wrote:\n> With a repo structured as follows\n>\n> main-files\n> |- submod\n>     |- subsubmodule\n>\n> git mv submod newlocation\n>\n> does not do what it is supposed to do. It actually breaks the git repository.\n> It can be fixed easily.\n> A complete description of the bug, including a workaround, can be found on\n> http://stackoverflow.com/q/32782382/2274140\n\nWhich version of Git are you using?\nI think this is fixed in a127331cd81233 (mv: allow moving nested\nsubmodules, 2016-04-19), which is first included in v2.8.3\n(or v2.9 and later).\n\nThanks,\nStefan\n\n>\n> --\n> Bart Bogaerts\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"},{"id":"290324","messageId":"CAOG-3GJ5arRRixEAjMt00jp3A+ZQQ3bGXa+ZUQrpffJyAOP_4w@mail.gmail.com","threadId":"42721","inReplyTo":"CAGZ79kYKBxL4xLyySALBv_-gqkss9_iCk-qSc4T7u7fKDMOFWw@mail.gmail.com","subject":"Re: Git mv -- submodule -- recursive","fromName":"Bart Bogaerts","fromEmail":"bartbogaerts@gmail.com","sentAt":"2016-06-27T20:07:06Z","receivedAt":"2016-06-27T20:07:52Z","isPatch":false,"sender":{"key":"bartbogaerts@gmail.com","avatar":"https://gravatar.com/avatar/c85570cbecf4bbdc221a0e4470af017d3c77ce80e865e2d565304ead921a2698?d=mp&s=160"},"body":"Hi,\n\nI tested this on git version 2.9 and it still fails (exactly the same\nbehaviour as on the stackoverflow post; also the workarounded I posted\nthere still works).\nSome output showing the bug follows below:\n\n\nbartb@EB-Latitude-E5450 ~/Documents/papers $ git status\nOn branch master\nYour branch is up-to-date with 'origin/master'.\nnothing to commit, working directory clean\nbartb@EB-Latitude-E5450 ~/Documents/papers $ git --version\ngit version 2.9.0\nbartb@EB-Latitude-E5450 ~/Documents/papers $ git mv fo-c-revisited/ 2016\nbartb@EB-Latitude-E5450 ~/Documents/papers $ git status\nfatal: Not a git repository:\nidp-latex/../../.git/modules/fo-c-revisited/modules/idp-latex\nfatal: 'git status --porcelain' failed in submodule 2016/fo-c-revisited\nbartb@EB-Latitude-E5450 ~/Documents/papers $ rm\n2016/fo-c-revisited/idp-latex/.git\nbartb@EB-Latitude-E5450 ~/Documents/papers $ git submodule update\nbartb@EB-Latitude-E5450 ~/Documents/papers $ git status\nOn branch master\nYour branch is up-to-date with 'origin/master'.\nChanges to be committed:\n  (use \"git reset HEAD <file>...\" to unstage)\n\nmodified:   .gitmodules\nrenamed:    fo-c-revisited -> 2016/fo-c-revisited\n\nbartb@EB-Latitude-E5450 ~/Documents/papers $\n\n2016-06-27 19:57 GMT+03:00 Stefan Beller <sbeller@google.com>:\n> On Sun, Jun 26, 2016 at 11:01 PM, Bart Bogaerts <bartbogaerts@gmail.com> wrote:\n>> With a repo structured as follows\n>>\n>> main-files\n>> |- submod\n>>     |- subsubmodule\n>>\n>> git mv submod newlocation\n>>\n>> does not do what it is supposed to do. It actually breaks the git repository.\n>> It can be fixed easily.\n>> A complete description of the bug, including a workaround, can be found on\n>> http://stackoverflow.com/q/32782382/2274140\n>\n> Which version of Git are you using?\n> I think this is fixed in a127331cd81233 (mv: allow moving nested\n> submodules, 2016-04-19), which is first included in v2.8.3\n> (or v2.9 and later).\n>\n> Thanks,\n> Stefan\n>\n>>\n>> --\n>> Bart Bogaerts\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\n-- \nBart Bogaerts\n"},{"id":"290328","messageId":"CAGZ79kbdb39NAF4wC35aH6kY7QGTjqkg=Q1RWmOzcO_d9-ZMHA@mail.gmail.com","threadId":"42721","inReplyTo":"CAOG-3GJ5arRRixEAjMt00jp3A+ZQQ3bGXa+ZUQrpffJyAOP_4w@mail.gmail.com","subject":"Re: Git mv -- submodule -- recursive","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-06-27T21:20:24Z","receivedAt":"2016-06-27T21:20:30Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Mon, Jun 27, 2016 at 1:07 PM, Bart Bogaerts <bartbogaerts@gmail.com> wrote:\n> Hi,\n>\n> I tested this on git version 2.9 and it still fails (exactly the same\n> behaviour as on the stackoverflow post; also the workarounded I posted\n> there still works).\n\nI see. the commit I referenced was solving a slightly different problem, than\nwhat we do here. That commit only fixed the issue for submodules in a nested\ndirectory.\n\nThe important detail what is different in this case is having another\nnested submodule.\n\nIf you only had\n\n- git-repo a\n-- subdirectory 2015\n--- git-submodule b\n-- git-submodule c\n\n(quoted from SO)\n\nthen `git mv c 2015/` is expected to work as well as\n`mkdir d && git mv 2015 d/` with submodule b being nested in 2015.\n\nbut as you have a submodule inside of c, moving c is buggy.\n\nStefan\n"}]}