update documentation for new zdiff3 conflictStyle

Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Dec 1, 2021 at 00:05 UTC ddfc44a898a58311392a5329687a1813d6b94779
9 files changed +50 -21
Documentation/config/merge.txt
+8 -1
@@ -4,7 +4,14 @@ merge.conflictStyle::
4 shows a `<<<<<<<` conflict marker, changes made by one side,
5 a `=======` marker, changes made by the other side, and then
6 a `>>>>>>>` marker. An alternate style, "diff3", adds a `|||||||`
7 - marker and the original text before the `=======` marker.
7 + marker and the original text before the `=======` marker. The
8 + "merge" style tends to produce smaller conflict regions than diff3,
9 + both because of the exclusion of the original text, and because
10 + when a subset of lines match on the two sides they are just pulled
11 + out of the conflict region. Another alternate style, "zdiff3", is
12 + similar to diff3 but removes matching lines on the two sides from
13 + the conflict region when those matching lines appear near either
14 + the beginning or end of a conflict region.
15
16 merge.defaultToUpstream::
17 If merge is called without any commit argument, merge the upstream
Documentation/git-checkout.txt
+1 -2
@@ -266,8 +266,7 @@ When switching branches with `--merge`, staged changes may be lost.
266 The same as `--merge` option above, but changes the way the
267 conflicting hunks are presented, overriding the
268 `merge.conflictStyle` configuration variable. Possible values are
269 - "merge" (default) and "diff3" (in addition to what is shown by
270 - "merge" style, shows the original contents).
269 + "merge" (default), "diff3", and "zdiff3".
270
271 -p::
272 --patch::
Documentation/git-merge-file.txt
+3
@@ -70,6 +70,9 @@ OPTIONS
70 --diff3::
71 Show conflicts in "diff3" style.
72
73 +--zdiff3::
74 + Show conflicts in "zdiff3" style.
75 +
76 --ours::
77 --theirs::
78 --union::
Documentation/git-merge.txt
+27 -5
@@ -240,7 +240,8 @@ from the RCS suite to present such a conflicted hunk, like this:
240
241 ------------
242 Here are lines that are either unchanged from the common
243 -ancestor, or cleanly resolved because only one side changed.
243 +ancestor, or cleanly resolved because only one side changed,
244 +or cleanly resolved because both sides changed the same way.
245 <<<<<<< yours:sample.txt
246 Conflict resolution is hard;
247 let's go shopping.
@@ -261,16 +262,37 @@ side wants to say it is hard and you'd prefer to go shopping, while the
262 other side wants to claim it is easy.
263
264 An alternative style can be used by setting the "merge.conflictStyle"
264 -configuration variable to "diff3". In "diff3" style, the above conflict
265 -may look like this:
265 +configuration variable to either "diff3" or "zdiff3". In "diff3"
266 +style, the above conflict may look like this:
267
268 ------------
269 Here are lines that are either unchanged from the common
269 -ancestor, or cleanly resolved because only one side changed.
270 +ancestor, or cleanly resolved because only one side changed,
271 <<<<<<< yours:sample.txt
272 +or cleanly resolved because both sides changed the same way.
273 Conflict resolution is hard;
274 let's go shopping.
273 -|||||||
275 +||||||| base:sample.txt
276 +or cleanly resolved because both sides changed identically.
277 +Conflict resolution is hard.
278 +=======
279 +or cleanly resolved because both sides changed the same way.
280 +Git makes conflict resolution easy.
281 +>>>>>>> theirs:sample.txt
282 +And here is another line that is cleanly resolved or unmodified.
283 +------------
284 +
285 +while in "zdiff3" style, it may look like this:
286 +
287 +------------
288 +Here are lines that are either unchanged from the common
289 +ancestor, or cleanly resolved because only one side changed,
290 +or cleanly resolved because both sides changed the same way.
291 +<<<<<<< yours:sample.txt
292 +Conflict resolution is hard;
293 +let's go shopping.
294 +||||||| base:sample.txt
295 +or cleanly resolved because both sides changed identically.
296 Conflict resolution is hard.
297 =======
298 Git makes conflict resolution easy.
Documentation/git-rebase.txt
+3 -3
@@ -714,9 +714,9 @@ information about the rebased commits and their parents (and instead
714 generates new fake commits based off limited information in the
715 generated patches), those commits cannot be identified; instead it has
716 to fall back to a commit summary. Also, when merge.conflictStyle is
717 -set to diff3, the apply backend will use "constructed merge base" to
718 -label the content from the merge base, and thus provide no information
719 -about the merge base commit whatsoever.
717 +set to diff3 or zdiff3, the apply backend will use "constructed merge
718 +base" to label the content from the merge base, and thus provide no
719 +information about the merge base commit whatsoever.
720
721 The merge backend works with the full commits on both sides of history
722 and thus has no such limitations.
Documentation/git-restore.txt
+1 -2
@@ -92,8 +92,7 @@ in linkgit:git-checkout[1] for details.
92 The same as `--merge` option above, but changes the way the
93 conflicting hunks are presented, overriding the
94 `merge.conflictStyle` configuration variable. Possible values
95 - are "merge" (default) and "diff3" (in addition to what is
96 - shown by "merge" style, shows the original contents).
95 + are "merge" (default), "diff3", and "zdiff3".
96
97 --ignore-unmerged::
98 When restoring files on the working tree from the index, do
Documentation/git-switch.txt
+1 -2
@@ -137,8 +137,7 @@ should result in deletion of the path).
137 The same as `--merge` option above, but changes the way the
138 conflicting hunks are presented, overriding the
139 `merge.conflictStyle` configuration variable. Possible values are
140 - "merge" (default) and "diff3" (in addition to what is shown by
141 - "merge" style, shows the original contents).
140 + "merge" (default), "diff3", and "zdiff3".
141
142 -q::
143 --quiet::
Documentation/technical/rerere.txt
+5 -5
@@ -14,9 +14,9 @@ conflicts before writing them to the rerere database.
14
15 Different conflict styles and branch names are normalized by stripping
16 the labels from the conflict markers, and removing the common ancestor
17 -version from the `diff3` conflict style. Branches that are merged
18 -in different order are normalized by sorting the conflict hunks. More
19 -on each of those steps in the following sections.
17 +version from the `diff3` or `zdiff3` conflict styles. Branches that
18 +are merged in different order are normalized by sorting the conflict
19 +hunks. More on each of those steps in the following sections.
20
21 Once these two normalization operations are applied, a conflict ID is
22 calculated based on the normalized conflict, which is later used by
@@ -42,8 +42,8 @@ get a conflict like the following:
42 >>>>>>> AC
43
44 Doing the analogous with AC2 (forking a branch ABAC2 off of branch AB
45 -and then merging branch AC2 into it), using the diff3 conflict style,
46 -we get a conflict like the following:
45 +and then merging branch AC2 into it), using the diff3 or zdiff3
46 +conflict style, we get a conflict like the following:
47
48 <<<<<<< HEAD
49 B
builtin/checkout.c
+1 -1
@@ -1517,7 +1517,7 @@ static struct option *add_common_options(struct checkout_opts *opts,
1517 OPT_BOOL(0, "progress", &opts->show_progress, N_("force progress reporting")),
1518 OPT_BOOL('m', "merge", &opts->merge, N_("perform a 3-way merge with the new branch")),
1519 OPT_STRING(0, "conflict", &opts->conflict_style, N_("style"),
1520 - N_("conflict style (merge or diff3)")),
1520 + N_("conflict style (merge, diff3, or zdiff3)")),
1521 OPT_END()
1522 };
1523 struct option *newopts = parse_options_concat(prevopts, options);