Suppose I've just updated my submodules:
rwbarton@morphism:~/ghc-newest$ git submodule update Submodule path 'libraries/process': checked out '296cbce6294316d6534b4449fc7ab0f0d3f5775b' Submodule path 'libraries/transformers': checked out 'a2f7dd057a0ee0c6cb206609594d7a07d26a1861'
And then I apply a patch with arc patch --nobranch. This patch doesn't do anything special with submodules, it just changes a few files in the main repository. But it was based on a commit that had an older version of the submodules than the commit I am currently on does.
rwbarton@morphism:~/ghc-newest$ arc patch --nobranch D1847 Created and checked out branch arcpatch-D1847. Checking patch compiler/nativeGen/X86/Ppr.hs... Checking patch compiler/nativeGen/SPARC/Ppr.hs... Checking patch compiler/nativeGen/PPC/Ppr.hs... Applied patch compiler/nativeGen/X86/Ppr.hs cleanly. Applied patch compiler/nativeGen/SPARC/Ppr.hs cleanly. Applied patch compiler/nativeGen/PPC/Ppr.hs cleanly. Submodule path 'libraries/Cabal': checked out 'a8a121ea4d78783dd303dd2992d8e73ef337e7ed' Submodule path 'libraries/process': checked out '0edb97876c2f783b33f9a69089ca9d26a061e112' Submodule path 'libraries/random': checked out 'cfdfe6f09ad414fde5b855cc5f90207533413241' Submodule path 'libraries/stm': checked out '844f84c21f94282187f35a6684d3c3c9f32cf2df' Submodule path 'libraries/transformers': checked out '1a2bc4ecada9561911e9c2e8a98a3c6bf59b7bb1' OKAY Successfully committed patch.
Now I have the patch applied on top of the commit I was just on, but I have the wrong version of the submodules checked out. I need to remember to update them again before I can build.
rwbarton@morphism:~/ghc-newest$ git submodule update Submodule path 'libraries/Cabal': checked out 'ecdf65a3c1e01b798e9d073258a6d1c8ff63a6d8' Submodule path 'libraries/process': checked out '296cbce6294316d6534b4449fc7ab0f0d3f5775b' Submodule path 'libraries/random': checked out 'c72dd0a01ae6255bead2d4fad33f002bb5684030' Submodule path 'libraries/stm': checked out '302aabc3799550b487a45f4c037b9ffbc0cfbc9a' Submodule path 'libraries/transformers': checked out 'a2f7dd057a0ee0c6cb206609594d7a07d26a1861'
arc patch --nobranch should do this for me and put the submodules back to how they were originally.
A sample output of running with --trace is here. Somewhere after git checkout 'master', arc should run git submodule update --init --recursive again.