Skip to content

Commit 4ebba56

Browse files
lucasoshirogitster
authored andcommitted
merge-strategies.adoc: detail submodule merge
Submodule merges are, in general, similar to other merges based on oid three-way-merge. When a conflict happens, however, Git has two special cases (introduced in 68d03e4) on handling the conflict before yielding it to the user. From the merge-ort and merge-recursive sources: - "Case #1: a is contained in b or vice versa": both strategies try to perform a fast-forward in the submodules if the commit referred by the conflicted submodule is descendant of another; - "Case #2: There are one or more merges that contain a and b in the submodule. If there is only one, then present it as a suggestion to the user, but leave it marked unmerged so the user needs to confirm the resolution." Add a small paragraph on merge-strategies.adoc describing this behavior. Helped-by: Junio C Hamano <[email protected]> Helped-by: Elijah Newren <[email protected]> Signed-off-by: Lucas Seiki Oshiro <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55b5ba8 commit 4ebba56

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Documentation/merge-strategies.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ ort::
2222
was written as a replacement for the previous default
2323
algorithm, `recursive`.
2424
+
25+
In the case where the path is a submodule, if the submodule commit used on
26+
one side of the merge is a descendant of the submodule commit used on the
27+
other side of the merge, Git attempts to fast-forward to the
28+
descendant. Otherwise, Git will treat this case as a conflict, suggesting
29+
as a resolution a submodule commit that is descendant of the conflicting
30+
ones, if one exists.
31+
+
2532
The 'ort' strategy can take the following options:
2633

2734
ours;;
@@ -96,6 +103,9 @@ recursive::
96103
the default strategy for resolving two heads from Git v0.99.9k
97104
until v2.33.0.
98105
+
106+
For a path that is a submodule, the same caution as 'ort' applies to this
107+
strategy.
108+
+
99109
The 'recursive' strategy takes the same options as 'ort'. However,
100110
there are three additional options that 'ort' ignores (not documented
101111
above) that are potentially useful with the 'recursive' strategy:

0 commit comments

Comments
 (0)