git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Sholik <alcosholik@gmail.com>
To: git@vger.kernel.org
Subject: Re: submodule/index/working tree woes
Date: Sat, 25 Jun 2011 14:02:29 +0300	[thread overview]
Message-ID: <BANLkTi=4D1qqM+9EFZACHwVwSsVOkWQ4GQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTik6xij0ZNy9nB2sbiF97Z4EF76sHQ@mail.gmail.com>

---------- Forwarded message ----------
From: Alexei Sholik <alcosholik@gmail.com>
Date: 25 June 2011 14:00
Subject: Re: submodule/index/working tree woes
To: masterblaster@vmware.com


On 24 June 2011 21:25, John Powell <jpowell@vmware.com> wrote:
> I have no changes to be committed (tracked or untracked according to
> 'git status') and yet when I try and switch branches git complains
> that I have untracked working tree files that would be overridden
> and aborts before the switch.
>
> The change I have just committed locally removes some files from the
> repository and adds a submodule in it's place to better organize the
> source for the project.
>
> Shaka, when the walls fell.  Anyone want to assist me with this issue?
> Feeling clueless.
>

Git is unable to remove a directory with submodule when switching
branches. If you have a submodule on one branch and a directory with
the same name on another branch, you'll have troubles.

I'm speaking of version 1.7.3.4. Here's a small demo:
$ mkdir test
$ cd test
$ git init
Initialized empty Git repository in /Users/alco/Documents/git/test/.git/
$ echo "Hello" >file.txt
$ git add file.txt
$ git commit -m 'test'
[master (root-commit) 8e9c724] test
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file.txt
$ git checkout -b another
Switched to a new branch 'another'
$ echo "Bye" >file2.txt
$ git add file2.txt
$ git commit -m 'second'
[another 62e6da2] second
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 file2.txt
$ git checkout master
Switched to branch 'master'
$ git submodule add git://github.com/tweepy/tweepy.git
Cloning into tweepy...
...
$ git commit -m 'submodule'
[master 3c9b6f7] submodule
 2 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 tweepy
$ git checkout another
warning: unable to rmdir tweepy: Directory not empty
Switched to branch 'another'
$ ls tweepy/
CONTRIBUTORS    INSTALL         LICENSE         README          docs
         examples        setup.py        tests.py        tools
  tweepy
$ git version
git version 1.7.3.4

--
Best regards,
Alexei Sholik



-- 
Best regards,
Alexei Sholik

      parent reply	other threads:[~2011-06-25 11:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24 18:25 submodule/index/working tree woes John Powell
     [not found] ` <BANLkTik6xij0ZNy9nB2sbiF97Z4EF76sHQ@mail.gmail.com>
2011-06-25 11:02   ` Alexei Sholik [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='BANLkTi=4D1qqM+9EFZACHwVwSsVOkWQ4GQ@mail.gmail.com' \
    --to=alcosholik@gmail.com \
    --cc=git@vger.kernel.org \
    /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).