{"thread":{"id":"56726","subject":"Possible bug with checkout and submodules","startedAt":"2021-10-16T18:44:42Z","lastAt":"2021-10-17T00:30:07Z","messageCount":4,"participants":["Adam Hutchings","brian m. carlson","Philippe Blain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"438952","messageId":"CADTYju0PpHHG1=S3N4MDWk5yZqb5t_KUhiDvZ_2i-vXFUT_LDw@mail.gmail.com","threadId":"56726","inReplyTo":null,"subject":"Possible bug with checkout and submodules","fromName":"Adam Hutchings","fromEmail":"adam.abahot@gmail.com","sentAt":"2021-10-16T18:44:04Z","receivedAt":"2021-10-16T18:44:42Z","isPatch":false,"sender":{"key":"adam.abahot@gmail.com","avatar":null},"body":"Hi,\n\nI may have found a bug in Git but I'm not sure if it's intentional or not. I\n\nchecked out to a new branch to test a PR on my repo, and the PR added a\n\nsubmodule. I init'ed and updated the submodule, and when I was done testing, I\n\nwent back to my main branch. However, it did not remove the submodule, and\n\nproduced this message:\n\n\n```\n\n$ git checkout main\n\nwarning: unable to rmdir 'glfw': Directory not empty\n\nSwitched to branch 'main'\n\n$\n\n```\n\n\nA friend of mine has managed to reproduce this behavior. We believe the expected\n\noutcome is to remove the submodule folder, but this does not seem to happen. Is\n\nthis intentional?\n\n\nBest,\n\n\n\nAdam Hutchings\n"},{"id":"438953","messageId":"YWsffmtRQKQGxkiR@camp.crustytoothpaste.net","threadId":"56726","inReplyTo":"CADTYju0PpHHG1=S3N4MDWk5yZqb5t_KUhiDvZ_2i-vXFUT_LDw@mail.gmail.com","subject":"Re: Possible bug with checkout and submodules","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-10-16T18:52:46Z","receivedAt":"2021-10-16T18:52:55Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-10-16 at 18:44:04, Adam Hutchings wrote:\n> Hi,\n> \n> I may have found a bug in Git but I'm not sure if it's intentional or not. I\n> \n> checked out to a new branch to test a PR on my repo, and the PR added a\n> \n> submodule. I init'ed and updated the submodule, and when I was done testing, I\n> \n> went back to my main branch. However, it did not remove the submodule, and\n> \n> produced this message:\n> \n> \n> ```\n> \n> $ git checkout main\n> \n> warning: unable to rmdir 'glfw': Directory not empty\n> \n> Switched to branch 'main'\n> \n> $\n> \n> ```\n> \n> \n> A friend of mine has managed to reproduce this behavior. We believe the expected\n> \n> outcome is to remove the submodule folder, but this does not seem to happen. Is\n> \n> this intentional?\n\nThis is intentional.  It may be that the submodule has data that's\nignored, it could have local changes, or it could have additional\nunpushed history, any of which would probably be data users might not\nwant to lose.  As a result, we don't remove the directory unless the\nuser has run \"git submodule deinit\".\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"},{"id":"438955","messageId":"CADTYju16KTNP_4cLs=Q=19r72ECgYnjLv=Y3nCNhX1fs1P-vxQ@mail.gmail.com","threadId":"56726","inReplyTo":"YWsffmtRQKQGxkiR@camp.crustytoothpaste.net","subject":"Re: Possible bug with checkout and submodules","fromName":"Adam Hutchings","fromEmail":"adam.abahot@gmail.com","sentAt":"2021-10-16T20:32:25Z","receivedAt":"2021-10-16T20:33:03Z","isPatch":false,"sender":{"key":"adam.abahot@gmail.com","avatar":null},"body":"OK, thank you!\n\nOn Sat, Oct 16, 2021 at 11:52 AM brian m. carlson\n<sandals@crustytoothpaste.net> wrote:\n>\n> On 2021-10-16 at 18:44:04, Adam Hutchings wrote:\n> > Hi,\n> >\n> > I may have found a bug in Git but I'm not sure if it's intentional or not. I\n> >\n> > checked out to a new branch to test a PR on my repo, and the PR added a\n> >\n> > submodule. I init'ed and updated the submodule, and when I was done testing, I\n> >\n> > went back to my main branch. However, it did not remove the submodule, and\n> >\n> > produced this message:\n> >\n> >\n> > ```\n> >\n> > $ git checkout main\n> >\n> > warning: unable to rmdir 'glfw': Directory not empty\n> >\n> > Switched to branch 'main'\n> >\n> > $\n> >\n> > ```\n> >\n> >\n> > A friend of mine has managed to reproduce this behavior. We believe the expected\n> >\n> > outcome is to remove the submodule folder, but this does not seem to happen. Is\n> >\n> > this intentional?\n>\n> This is intentional.  It may be that the submodule has data that's\n> ignored, it could have local changes, or it could have additional\n> unpushed history, any of which would probably be data users might not\n> want to lose.  As a result, we don't remove the directory unless the\n> user has run \"git submodule deinit\".\n> --\n> brian m. carlson (he/him or they/them)\n> Toronto, Ontario, CA\n"},{"id":"438957","messageId":"0d8ade7b-e5af-88ec-3e33-96d6c356b714@gmail.com","threadId":"56726","inReplyTo":"YWsffmtRQKQGxkiR@camp.crustytoothpaste.net","subject":"Re: Possible bug with checkout and submodules","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2021-10-17T00:30:02Z","receivedAt":"2021-10-17T00:30:07Z","isPatch":false,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Adam,\n\nLe 2021-10-16 à 14:52, brian m. carlson a écrit :\n> On 2021-10-16 at 18:44:04, Adam Hutchings wrote:\n>> Hi,\n>>\n>> I may have found a bug in Git but I'm not sure if it's intentional or not. I\n>>\n>> checked out to a new branch to test a PR on my repo, and the PR added a\n>>\n>> submodule. I init'ed and updated the submodule, and when I was done testing, I\n>>\n>> went back to my main branch. However, it did not remove the submodule, and\n>>\n>> produced this message:\n>>\n>>\n>> ```\n>>\n>> $ git checkout main\n>>\n>> warning: unable to rmdir 'glfw': Directory not empty\n>>\n>> Switched to branch 'main'\n>>\n>> $\n>>\n>> ```\n>>\n>>\n>> A friend of mine has managed to reproduce this behavior. We believe the expected\n>>\n>> outcome is to remove the submodule folder, but this does not seem to happen. Is\n>>\n>> this intentional?\n> \n> This is intentional.  It may be that the submodule has data that's\n> ignored, it could have local changes, or it could have additional\n> unpushed history, any of which would probably be data users might not\n> want to lose.  As a result, we don't remove the directory unless the\n> user has run \"git submodule deinit\".\n> \n\n... or unless you run 'git checkout --recurse-submodules', or just\n'git checkout' and you have 'submodule.recurse' set to true in your configuration.\n\nCheers,\nPhilippe.\n"}]}