Submodules on a branch

· I’m on a branch wip/T11067. · I do a ‘git merge origin/master’, resolve source code conflicts and commit · Then ‘git submodule update’ · I have not touched libraries/unix · Yet when I say “git submodule” in a different HEAD tree, I get a different commit for libraries/unix than in my branch Question (sticking plaster): how can I say “Just make my sub-modules match HEAD please”? Question (cause): how can I ensure that I do update my branch to the submodule of HEAD when doing ‘git merge’? Getting submodules out of sync is very tiresome. Thanks Simon

Simon Peyton Jones
· I’m on a branch wip/T11067.
Hi Simon!
· I do a ‘git merge origin/master’, resolve source code conflicts and commit
· Then ‘git submodule update’
· I have not touched libraries/unix
· Yet when I say “git submodule” in a different HEAD tree, I get a different commit for libraries/unix than in my branch
Question (sticking plaster): how can I say “Just make my sub-modules match HEAD please”?
I've written a script to do just this [1], $ wget https://gist.github.com/bgamari/919e1279c1615b9b1cb4/raw/bbb1be6106b73f05d35... $ chmod ugo+rx checkout-submodules [ensure it's in $PATH] $ cd $path_to_ghc $ checkout-submodules master [a bit of output is produced] $ git commit -m "synchronize submodules with master branch" This should checkout the submodule revisions of the master branch in the $path_to_ghc tree and commit them.
Question (cause): how can I ensure that I do update my branch to the submodule of HEAD when doing ‘git merge’?
The cause is indeed a bit perplexing. I'll try to reproduce tonight with the pre-merge state of your T11067 branch. Cheers, - Ben [1] https://gist.github.com/bgamari/919e1279c1615b9b1cb4
participants (2)
-
Ben Gamari
-
Simon Peyton Jones