git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philippe Blain <levraiphilippeblain@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Adam Hutchings <adam.abahot@gmail.com>,
	git@vger.kernel.org
Subject: Re: Possible bug with checkout and submodules
Date: Sat, 16 Oct 2021 20:30:02 -0400	[thread overview]
Message-ID: <0d8ade7b-e5af-88ec-3e33-96d6c356b714@gmail.com> (raw)
In-Reply-To: <YWsffmtRQKQGxkiR@camp.crustytoothpaste.net>

Hi Adam,

Le 2021-10-16 à 14:52, brian m. carlson a écrit :
> 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".
> 

... or unless you run 'git checkout --recurse-submodules', or just
'git checkout' and you have 'submodule.recurse' set to true in your configuration.

Cheers,
Philippe.

      parent reply	other threads:[~2021-10-17  0:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16 18:44 Possible bug with checkout and submodules Adam Hutchings
2021-10-16 18:52 ` brian m. carlson
2021-10-16 20:32   ` Adam Hutchings
2021-10-17  0:30   ` Philippe Blain [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d8ade7b-e5af-88ec-3e33-96d6c356b714@gmail.com \
    --to=levraiphilippeblain@gmail.com \
    --cc=adam.abahot@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).