Why git reset --hard doesn't reset commit hash in submodules?

Viewed 300

I have project with 4 submodules, 2 of them are out of sychronisation:

$ git submodule status
+ae633d13612e49a4d636ade1b20de7c306de9a40 devops-tools (heads/master)
 361fad5d187573d9bbb6aef67599f434c0bb7260 factorie (factorie_2.11-1.2-74-g361fad5d1)
 e702f2ffe7fa785acc97983500be6b6f995d5fa1 foundation (heads/master)
+69330f56f5db54c28a95752c7cc3a974af9cdd5e spookystuff (0.3.0-RC1-1167-g69330f56)

The little + indicates that these commit hashes are not staged, the synched commit hashes can be seen in the following message:

$ git submodule summary
* devops-tools 2e576eb...ae633d1 (2):
  > Additional tests for local and chained passports
  > Add policy for github issue 278

* spookystuff feeec3e...69330f5 (3):
  > fix an NPE caused by val overriding def ctg
  > move 1 closure out of test body to avoid a NotSerialisable error
  > fix a serialisation error merge process name & command into a single condition Fixed a few test case due to parser injection Additional tests for local and chained passports fix 2 pattern matching errors caused by type erasure several refactorings that use more accurate names

I want to synchronise them, so I execute the following command:

$ git add *
The following paths are ignored by one of your .gitignore files:
datapassports.iml
target
Use -f if you really want to add them.
$ git reset --hard
HEAD is now at e1d426df8 issue 284, ...

$ git submodule update --init --remote --recursive --force
Submodule path 'devops-tools': checked out 'ae633d13612e49a4d636ade1b20de7c306de9a40'
Submodule path 'factorie': checked out '361fad5d187573d9bbb6aef67599f434c0bb7260'
Submodule path 'foundation': checked out 'e702f2ffe7fa785acc97983500be6b6f995d5fa1'
Submodule path 'spookystuff': checked out '69330f56f5db54c28a95752c7cc3a974af9cdd5e'

but it appears that nothing changed, the command git reset --hard FAILED to set submodules to the correct hash: 2e576eb and feeec3e respectively. What's the purpose of this design and how to fix it?

0 Answers
Related