We are currently refactoring code to be shared among different projects in our company. This shared code will be included in other projects as a Git submodule.
One thing we're worried of is breaking changes introduced to the super project from the submodule at certain stages of the project (e.g: a point where we should be stable / code freeze).
I have never worked with submodules before, but according to what I know, a submodule references a particular commit in another repo, so you're basically OK as long as you don't update the submodule in the project.
Another teammate of mine suggested that whenever we enter a "stable phase" of the project (e.g: finish dev), we should create a branch of the submodule and point to that. I think this is an overhead and seems wrong (a shared project shouldn't be version-locked with other projects that use it).
So, to sum it up, my questions are:
- Is there anything at all that should be done to protect a super project from submodules updates (breaking changes) ?
- Is there a known workflow where a super project that goes into a stable phase, also creates a new branch of its submodules to point to? (a link would be great).