git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Possible bug with checkout and submodules

From
AHAdam Hutchings <adam.abahot@gmail.com>
Date
Oct 16, 2021, 20:32 UTC
Message-ID
<CADTYju16KTNP_4cLs=Q=19r72ECgYnjLv=Y3nCNhX1fs1P-vxQ@mail.gmail.com>
In-Reply-To
<YWsffmtRQKQGxkiR@camp.crustytoothpaste.net>
OK, thank you!

On Sat, Oct 16, 2021 at 11:52 AM brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 42 quoted lines
>
> On 2021-10-16 at 18:44:04, Adam Hutchings wrote:
> > Hi,
> >
> > I may have found a bug in Git but I'm not sure if it's intentional or not. I
> >
> > checked out to a new branch to test a PR on my repo, and the PR added a
> >
> > submodule. I init'ed and updated the submodule, and when I was done testing, I
> >
> > went back to my main branch. However, it did not remove the submodule, and
> >
> > produced this message:
> >
> >
> > ```
> >
> > $ git checkout main
> >
> > warning: unable to rmdir 'glfw': Directory not empty
> >
> > Switched to branch 'main'
> >
> > $
> >
> > ```
> >
> >
> > A friend of mine has managed to reproduce this behavior. We believe the expected
> >
> > outcome is to remove the submodule folder, but this does not seem to happen. Is
> >
> > this intentional?
>
> This is intentional.  It may be that the submodule has data that's
> ignored, it could have local changes, or it could have additional
> unpushed history, any of which would probably be data users might not
> want to lose.  As a result, we don't remove the directory unless the
> user has run "git submodule deinit".
> --
> brian m. carlson (he/him or they/them)
> Toronto, Ontario, CA
Previous: brian m. carlsonNext: Philippe Blain
Message 3 of 4 in “Possible bug with checkout and submodules”
  1. Adam HutchingsOct 16, 2021
  2. brian m. carlsonOct 16, 2021
  3. Adam HutchingsOct 16, 2021
  4. Philippe BlainOct 17, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.