3 ms·
Submodules are just complicated because Git makes no decisions at all about how they should behave, beyond "never make a decision that could lose data". So you
by Groxx 4y ago
Submodules are just complicated because Git makes no decisions at all about how they should behave, beyond "never make a decision that could lose data".
So you have to understand the tradeoffs and make every decision at every step. It's the safe option.
Like, what happens if you remove a submodule between revisions? Git won't remove the files, you could have stuff in there. So it just dangles there, as a pile of changed files that you now have to separately, manually remove or commit, because it's no longer tracked as a submodule. And then repeat this same kind of "X could sometimes be risky, so don't do it" behavior for dozens of scenarios.
All of which is in some ways reasonable, and is very much "Git-like behavior". But it's annoying, and if you don't really understand it all it seems like it's just getting in your way all the time for no good reason. Git has been very very slowly improving this behavior in general, but it's still taking an extremely conservative stance on everything, so it'll probably never be streamlined or automagic - making one set of decisions implicitly would get in the way of someone who wants different behavior.