Details
-
Suggestion
-
Resolution: Answered
-
None
-
None
Description
During merge from commit R into local commit L, with some merge-base B, if they refer to corresponding commits R' L' and B' in a submodule, and those are different, Git (and stash) will report a merge conflict. But, if the merge is performed in local reporitory, and the submodule is checked-out, git will inspect its history and check if L' is a ancestor of R'. If it is, it will fast-forward the submodule to R' without reporting conflict. It works since https://github.com/git/git/commit/68d03e4a6e44
If stash could perform this in server-side merges it would let go most of the conflicts complaints developers experience with submodules. One way to achieve it is to just have the submodules initialized in the server repository (it is possible to avoid prformance issues with use of alternate object storage and skip-worktree flag), but I'm not sure how will it affect other functionality, it can break something.