First of all, let me just say that this question may not fit on SoftwareEngineering.SE even though its similar to a "white-board" question. This question has to do specifically with Git so I figured I would ask it here on SO instead. This is more of a "how do I do it" or "what do I need to be concerned about" question... I also need to ask this question first so that I don't completely wreck one or more of my Git repositories.
Anyway, I have a Git repository for an application that I am currently building. This application has several submodules included, one for each of the libraries that the application depends on. Now, some of my submodules depend on one another. For instance I have a few different implementations in some submodules, that depend on some specific interface in a separate submodule.
I am thinking of making the interface library a submodule of each implementation library... Well, for the sake of this question it doesn't have to be an interface. Let's just say that there are libraries involved that have submodules of their own. Now to the question...
What if in the future I need to support two different implementations in a new application... What happens when I include both implementations as submodules to the application? Especially... What if a common submodule got updated... One implementation needs V1.0 and another implementation needs V2.0? Is there some kind of a conflict?
P.S. What I am really trying to get out of this question... Is a way to have my submodules each have a reference to a certain commit # (for the libraries they depend on) which they need in order to compile... If this isn't the right way, then I'm open to alternatives.