Skip to content

Commit 179f877

Browse files
jnavilagitster
authored andcommitted
doc: convert merge strategies to synopsis format
- Switch the synopsis to a synopsis block which will automatically format placeholders in italics and keywords in monospace - Use _<placeholder>_ instead of <placeholder> in the description - Use `backticks` for keywords and more complex option descriptions. The new rendering engine will apply synopsis rules to these spans. Signed-off-by: Jean-Noël Avila <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cbbb3b2 commit 179f877

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

Documentation/merge-strategies.adoc

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ backend 'merge strategies' to be chosen with `-s` option. Some strategies
66
can also take their own options, which can be passed by giving `-X<option>`
77
arguments to `git merge` and/or `git pull`.
88

9-
ort::
9+
`ort`::
1010
This is the default merge strategy when pulling or merging one
1111
branch. This strategy can only resolve two heads using a
1212
3-way merge algorithm. When there is more than one common
@@ -29,26 +29,26 @@ descendant. Otherwise, Git will treat this case as a conflict, suggesting
2929
as a resolution a submodule commit that is descendant of the conflicting
3030
ones, if one exists.
3131
+
32-
The 'ort' strategy can take the following options:
32+
The `ort` strategy can take the following options:
3333

34-
ours;;
34+
`ours`;;
3535
This option forces conflicting hunks to be auto-resolved cleanly by
3636
favoring 'our' version. Changes from the other tree that do not
3737
conflict with our side are reflected in the merge result.
3838
For a binary file, the entire contents are taken from our side.
3939
+
40-
This should not be confused with the 'ours' merge strategy, which does not
40+
This should not be confused with the `ours` merge strategy, which does not
4141
even look at what the other tree contains at all. It discards everything
4242
the other tree did, declaring 'our' history contains all that happened in it.
4343

44-
theirs;;
45-
This is the opposite of 'ours'; note that, unlike 'ours', there is
46-
no 'theirs' merge strategy to confuse this merge option with.
44+
`theirs`;;
45+
This is the opposite of `ours`; note that, unlike `ours`, there is
46+
no `theirs` merge strategy to confuse this merge option with.
4747

48-
ignore-space-change;;
49-
ignore-all-space;;
50-
ignore-space-at-eol;;
51-
ignore-cr-at-eol;;
48+
`ignore-space-change`;;
49+
`ignore-all-space`;;
50+
`ignore-space-at-eol`;;
51+
`ignore-cr-at-eol`;;
5252
Treats lines with the indicated type of whitespace change as
5353
unchanged for the sake of a three-way merge. Whitespace
5454
changes mixed with other changes to a line are not ignored.
@@ -61,89 +61,89 @@ ignore-cr-at-eol;;
6161
version includes a substantial change, 'their' version is used;
6262
* Otherwise, the merge proceeds in the usual way.
6363

64-
renormalize;;
64+
`renormalize`;;
6565
This runs a virtual check-out and check-in of all three stages
6666
of any file which needs a three-way merge. This option is
6767
meant to be used when merging branches with different clean
6868
filters or end-of-line normalization rules. See "Merging
6969
branches with differing checkin/checkout attributes" in
7070
linkgit:gitattributes[5] for details.
7171

72-
no-renormalize;;
72+
`no-renormalize`;;
7373
Disables the `renormalize` option. This overrides the
7474
`merge.renormalize` configuration variable.
7575

76-
find-renames[=<n>];;
76+
`find-renames[=<n>]`;;
7777
Turn on rename detection, optionally setting the similarity
7878
threshold. This is the default. This overrides the
79-
'merge.renames' configuration variable.
79+
`merge.renames` configuration variable.
8080
See also linkgit:git-diff[1] `--find-renames`.
8181

82-
rename-threshold=<n>;;
82+
`rename-threshold=<n>`;;
8383
Deprecated synonym for `find-renames=<n>`.
8484

85-
no-renames;;
85+
`no-renames`;;
8686
Turn off rename detection. This overrides the `merge.renames`
8787
configuration variable.
8888
See also linkgit:git-diff[1] `--no-renames`.
8989

90-
histogram;;
90+
`histogram`;;
9191
Deprecated synonym for `diff-algorithm=histogram`.
9292

93-
patience;;
93+
`patience`;;
9494
Deprecated synonym for `diff-algorithm=patience`.
9595

96-
diff-algorithm=[histogram|minimal|myers|patience];;
96+
`diff-algorithm=(histogram|minimal|myers|patience)`;;
9797
Use a different diff algorithm while merging, which can help
9898
avoid mismerges that occur due to unimportant matching lines
9999
(such as braces from distinct functions). See also
100100
linkgit:git-diff[1] `--diff-algorithm`. Note that `ort`
101101
defaults to `diff-algorithm=histogram`, while regular diffs
102102
currently default to the `diff.algorithm` config setting.
103103

104-
subtree[=<path>];;
104+
`subtree[=<path>]`;;
105105
This option is a more advanced form of 'subtree' strategy, where
106106
the strategy makes a guess on how two trees must be shifted to
107107
match with each other when merging. Instead, the specified path
108108
is prefixed (or stripped from the beginning) to make the shape of
109109
two trees to match.
110110

111-
recursive::
111+
`recursive`::
112112
This is now a synonym for `ort`. It was an alternative
113113
implementation until v2.49.0, but was redirected to mean `ort`
114114
in v2.50.0. The previous recursive strategy was the default
115115
strategy for resolving two heads from Git v0.99.9k until
116116
v2.33.0.
117117

118-
resolve::
118+
`resolve`::
119119
This can only resolve two heads (i.e. the current branch
120120
and another branch you pulled from) using a 3-way merge
121121
algorithm. It tries to carefully detect criss-cross
122122
merge ambiguities. It does not handle renames.
123123

124-
octopus::
124+
`octopus`::
125125
This resolves cases with more than two heads, but refuses to do
126126
a complex merge that needs manual resolution. It is
127127
primarily meant to be used for bundling topic branch
128128
heads together. This is the default merge strategy when
129129
pulling or merging more than one branch.
130130

131-
ours::
131+
`ours`::
132132
This resolves any number of heads, but the resulting tree of the
133133
merge is always that of the current branch head, effectively
134134
ignoring all changes from all other branches. It is meant to
135135
be used to supersede old development history of side
136-
branches. Note that this is different from the -Xours option to
137-
the 'ort' merge strategy.
136+
branches. Note that this is different from the `-Xours` option to
137+
the `ort` merge strategy.
138138

139-
subtree::
139+
`subtree`::
140140
This is a modified `ort` strategy. When merging trees A and
141141
B, if B corresponds to a subtree of A, B is first adjusted to
142142
match the tree structure of A, instead of reading the trees at
143143
the same level. This adjustment is also done to the common
144144
ancestor tree.
145145

146-
With the strategies that use 3-way merge (including the default, 'ort'),
146+
With the strategies that use 3-way merge (including the default, `ort`),
147147
if a change is made on both branches, but later reverted on one of the
148148
branches, that change will be present in the merged result; some people find
149149
this behavior confusing. It occurs because only the heads and the merge base

0 commit comments

Comments
 (0)