{"thread":{"id":"11199","subject":"Submodules and merging","startedAt":"2007-12-08T18:40:31Z","lastAt":"2007-12-08T18:40:31Z","messageCount":1,"participants":["Finn Arne Gangstad"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"62424","messageId":"20071208184030.GA21613@pvv.org","threadId":"11199","inReplyTo":null,"subject":"Submodules and merging","fromName":"Finn Arne Gangstad","fromEmail":"finnag@pvv.org","sentAt":"2007-12-08T18:40:31Z","receivedAt":"2007-12-08T18:40:31Z","isPatch":false,"sender":{"key":"finnag@pvv.org","avatar":"https://gravatar.com/avatar/b421ddd58c3f0f93aa473e17b98bb8d53c221fef741746bc8cb59fae4ec6d95e?d=mp&s=160"},"body":">From an earlier discussion here on the mailing list I had the\nimpression that there was some support for merging submodules from the\nsupermodule. This does not seem to be the case, but I think it would\nbe very good if this WAS possible?\n\nHere is the shortest example that still mimics \"real\" work that shows\nthe problem. Assume change1 and change2 are done by two different\npeople in two different repositories and push this into separate\nbranches in a central repo somewhere. A maintainer at the central\nrepo wants to merge in one or both changes:\n\n\n# Create directory and some repos with a simple README\nrm -rf submodule-test\nmkdir submodule-test\ncd submodule-test\n( mkdir super-module; cd super-module; git init )\n( mkdir sub-module; cd sub-module; git init )\n\ncd super-module\necho 'this is the super module' > README\ngit add README\ngit commit -m 'added a readme'\n\ncd ../sub-module\necho 'this is the sub module' > README\ngit add README\ngit commit -m 'added a readme'\ncd ..\n\n# Make a testdir, clone the master repo, and add\n# the sub-module\nmkdir testdir\ncd testdir\ngit clone `pwd`/../super-module\ncd super-module\ngit submodule add `pwd`/../../sub-module\ngit commit -m 'added the submodule'\n\n# make change1 on a branch in both super and sub module\ngit checkout -b change1 \ncd sub-module/\ngit checkout -b sub-change1\necho 'This is change1' > change1\ngit add change1\ngit commit -m 'added change1 file'\ncd ..\ngit add sub-module\ngit commit -m 'did change1 in change1 branch'\n\n# Make change2 on a branch in both super and sub module\ngit checkout -b change2 master\ngit submodule update\ncd sub-module/\ngit checkout -b sub-change2\necho 'this is change2' > change2\ngit add change2\ngit commit -m 'added change2 file'\ncd ..\ngit add sub-module\ngit commit -m 'did the change2 change'\n\n# Try to merge change1 and change2\ngit checkout -b mergetest master\ngit submodule update\ngit merge change1\ngit merge change2 \n\n\n\nThis fails with the somewhat obscure error message:\nfatal: cannot merge modes?\nMerge with strategy recursive failed.\n\n- Finn Arne\n"}]}