git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Changing branches in supermodule does not affect submodule?
@ 2009-10-13 10:29 Peter Krefting
  2009-10-13 13:11 ` Jens Lehmann
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Krefting @ 2009-10-13 10:29 UTC (permalink / raw)
  To: Git Mailing List

Hi!

If I have a repository with submodules that is in a clean state, and switch 
branches in the super repository, the submodules are left in the state they 
were in before I switched branches (with 1.6.4, at least). Is this the 
expected behaviour?

--->8--8<---
#!/bin/bash
# Create supermodule.
mkdir super-$$
cd super-$$
git init

# Create submodule with commit.
mkdir sub
cd sub
git init
echo C > c.txt
echo D > d.txt
git add c.txt d.txt
git commit -m Created.
cd ..

# Create commit and branch in supermodule.
echo A > a.txt
echo B > b.txt
git add a.txt b.txt sub
git commit -m Created.
git tag branchpoint
git checkout -b branch1

# Create branch1 in submodule and commit.
cd sub
git checkout -b branch1
echo E > c.txt
echo F > d.txt
git add c.txt d.txt
git commit -m Branched.
cd ..

# Commit to a branch in the supermodule.
git add sub
git commit -m Sub-update.

# Status should now be clean.
git status

# Create a new branch in supermodule, from the original commit.
git checkout -b branch2 branchpoint

# I now expect the submodule to be up-to-date and the state clean.
git status
--->8--8<---

-- 
\\// Peter - http://www.softwolves.pp.se/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-14 20:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13 10:29 Changing branches in supermodule does not affect submodule? Peter Krefting
2009-10-13 13:11 ` Jens Lehmann
2009-10-14  6:31   ` Peter Krefting
2009-10-14 15:39     ` Jens Lehmann
2009-10-14 20:12       ` [RFC PATCH] implement sample post-checkout hook to checkout new/unchanged submodules Heiko Voigt
2009-10-14 20:02     ` Changing branches in supermodule does not affect submodule? Junio C Hamano

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).