Submodules on a branch

Ben Gamari ben at well-typed.com
Tue Dec 8 17:40:42 UTC 2015


Simon Peyton Jones <simonpj at microsoft.com> writes:

> ·         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/bbb1be6106b73f05d35eff256351187931d43ac3/checkout-submodules
    $ 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


More information about the ghc-devs mailing list