git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nico -telmich- Schottelius <nico-linux-git@schottelius.org>
To: git@vger.kernel.org
Cc: Steven Armstrong <steven.armstrong@inf.ethz.ch>
Subject: Submodule handling broken when changing branches?
Date: Tue, 15 Jun 2010 08:23:55 +0200	[thread overview]
Message-ID: <20100615062355.GA3096@schottelius.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

Good morning devs,

I'm wondering whether it is the intented behaviour that after
adding a submodule one is unable to change branchen?

Steps to reproduce

   ( mkdir sm && cd sm && touch a && git init && git add . && git commit -m "init" )

   ( mkdir -p project/smdir && cd project && touch smdir/a  && git init && git add . && git commit -m "init" && git branch second ) 

  ( cd project && git rm smdir/a &&  git commit -m "remove file that will be replaced by sm")
  
  ( cd project && git submodule add ~/temp/git/sm smdir && git submodule update --init && git commit -m "add submodule" )

  ( cd project && git checkout second )
  error: Untracked working tree file 'smdir/a' would be overwritten by merge.

It seems that the contents of a submodule are not cleanly moved away
when switching branches, I also see that in other places where the directory
is not known to the other branch, it will just stay.

If that is intented, what would be the clean way to switch the branch?
If so, shouldn't it be documented in the manpage?

Nico

-- 
New PGP key: 7ED9 F7D3 6B10 81D7 0EC5  5C09 D7DC C8E4 3187 7DF0
Please resign, if you signed 9885188C or 8D0E27A4.

Currently moving *.schottelius.org to http://www.nico.schottelius.org/ ...

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

                 reply	other threads:[~2010-06-15  6:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100615062355.GA3096@schottelius.org \
    --to=nico-linux-git@schottelius.org \
    --cc=git@vger.kernel.org \
    --cc=steven.armstrong@inf.ethz.ch \
    /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).