Document that merge strategies can now take their own options
Also document the recently added -Xtheirs, -Xours and -Xsubtree[=path] options to the merge-recursive strategy. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 18, 2008 at 02:43 UTC
566c511195adc0ce88559853f2f00933e241d862
2 files changed
+33
-1
Documentation/merge-options.txt
+5
@@ -74,3 +74,8 @@ option can be used to override --squash.
74
-v::
75
--verbose::
76
Be verbose.
77
+
78
+-X <option>::
79
+--strategy-option=<option>::
80
+ Pass merge strategy specific option through to the merge
81
+ strategy.
Documentation/merge-strategies.txt
+28
-1
@@ -1,6 +1,11 @@
1
MERGE STRATEGIES
2
----------------
3
4
+The merge mechanism ('git-merge' and 'git-pull' commands) allows the
5
+backend 'merge strategies' to be chosen with `-s` option. Some strategies
6
+can also take their own options, which can be passed by giving `-X<option>`
7
+arguments to 'git-merge' and/or 'git-pull'.
8
+
9
resolve::
10
This can only resolve two heads (i.e. the current branch
11
and another branch you pulled from) using a 3-way merge
@@ -20,6 +25,27 @@ recursive::
25
Additionally this can detect and handle merges involving
26
renames. This is the default merge strategy when
27
pulling or merging one branch.
28
++
29
+The 'recursive' strategy can take the following options:
30
+
31
+ours;;
32
+ This option forces conflicting hunks to be auto-resolved cleanly by
33
+ favoring 'our' version. Changes from the other tree that do not
34
+ conflict with our side are reflected to the merge result.
35
++
36
+This should not be confused with the 'ours' merge strategy, which does not
37
+even look at what the other tree contains at all. It discards everything
38
+the other tree did, declaring 'our' history contains all that happened in it.
39
+
40
+theirs;;
41
+ This is opposite of 'ours'.
42
+
43
+subtree[=path];;
44
+ This option is a more advanced form of 'subtree' strategy, where
45
+ the strategy makes a guess on how two trees must be shifted to
46
+ match with each other when merging. Instead, the specified path
47
+ is prefixed (or stripped from the beginning) to make the shape of
48
+ two trees to match.
49
50
octopus::
51
This resolves cases with more than two heads, but refuses to do
@@ -33,7 +59,8 @@ ours::
59
merge is always that of the current branch head, effectively
60
ignoring all changes from all other branches. It is meant to
61
be used to supersede old development history of side
36
- branches.
62
+ branches. Note that this is different from the -Xours option to
63
+ the 'recursive' merge strategy.
64
65
subtree::
66
This is a modified recursive strategy. When merging trees A and