Suppose I have two branches in RepoX called BranchA and BranchB. RepoX also has a submodule called SubmoduleY.
BranchA has a SubmoduleY revision of 'abc', BranchB has a SubmoduleY revision of 'def'.
Say I want to merge BranchA into BranchB, but I want to leave SubmoduleY BranchB, pointing to its original version of 'def'. I see a couple of ways to do this:
Method 1:
- Place an order on BranchB.
- Move SubmoduleY to the 'abc' revision to make the actual merge painless (we don't want to do the merge at the submodule level right now).
- Commit a new revision for SubmoduleY (we cannot float it for merging).
- Merge BranchA into BranchB. Elimination of any conflicts.
- Move SubmoduleY back to the 'def' version.
- Complete the new revision for SubmoduleY.
- Push changes to the main repo.
Method 2:
Same as method 1, but instead of doing step 6, reinstall and get rid of fixing the additional submodule from step 3.
Both seem to have annoying flaws:
Method 1 adds two additional entries to the story.
Method 2 forgets about any changes associated with changes to the submodule as these commits are deleted. Thus, any mergers will later deal with some problems again.
Is there a better way?
git merge git-submodules
Ben
source share