* Submodules and merging
@ 2007-12-08 18:40 Finn Arne Gangstad
0 siblings, 0 replies; only message in thread
From: Finn Arne Gangstad @ 2007-12-08 18:40 UTC (permalink / raw)
To: git
>From an earlier discussion here on the mailing list I had the
impression that there was some support for merging submodules from the
supermodule. This does not seem to be the case, but I think it would
be very good if this WAS possible?
Here is the shortest example that still mimics "real" work that shows
the problem. Assume change1 and change2 are done by two different
people in two different repositories and push this into separate
branches in a central repo somewhere. A maintainer at the central
repo wants to merge in one or both changes:
# Create directory and some repos with a simple README
rm -rf submodule-test
mkdir submodule-test
cd submodule-test
( mkdir super-module; cd super-module; git init )
( mkdir sub-module; cd sub-module; git init )
cd super-module
echo 'this is the super module' > README
git add README
git commit -m 'added a readme'
cd ../sub-module
echo 'this is the sub module' > README
git add README
git commit -m 'added a readme'
cd ..
# Make a testdir, clone the master repo, and add
# the sub-module
mkdir testdir
cd testdir
git clone `pwd`/../super-module
cd super-module
git submodule add `pwd`/../../sub-module
git commit -m 'added the submodule'
# make change1 on a branch in both super and sub module
git checkout -b change1
cd sub-module/
git checkout -b sub-change1
echo 'This is change1' > change1
git add change1
git commit -m 'added change1 file'
cd ..
git add sub-module
git commit -m 'did change1 in change1 branch'
# Make change2 on a branch in both super and sub module
git checkout -b change2 master
git submodule update
cd sub-module/
git checkout -b sub-change2
echo 'this is change2' > change2
git add change2
git commit -m 'added change2 file'
cd ..
git add sub-module
git commit -m 'did the change2 change'
# Try to merge change1 and change2
git checkout -b mergetest master
git submodule update
git merge change1
git merge change2
This fails with the somewhat obscure error message:
fatal: cannot merge modes?
Merge with strategy recursive failed.
- Finn Arne
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-08 18:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-08 18:40 Submodules and merging Finn Arne Gangstad
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).