summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Elijah Newren <newren@gmail.com>2021-12-01 00:05:07 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-12-01 14:45:59 -0800
commitddfc44a898a58311392a5329687a1813d6b94779 (patch)
treeb264cec304adc063f1f186bd799bebacc03edf53
parentxdiff: implement a zealous diff3, or "zdiff3" (diff)
downloadtgif-ddfc44a898a58311392a5329687a1813d6b94779.tar.xz
update documentation for new zdiff3 conflictStyle
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Documentation/config/merge.txt9
-rw-r--r--Documentation/git-checkout.txt3
-rw-r--r--Documentation/git-merge-file.txt3
-rw-r--r--Documentation/git-merge.txt32
-rw-r--r--Documentation/git-rebase.txt6
-rw-r--r--Documentation/git-restore.txt3
-rw-r--r--Documentation/git-switch.txt3
-rw-r--r--Documentation/technical/rerere.txt10
-rw-r--r--builtin/checkout.c2
9 files changed, 50 insertions, 21 deletions
diff --git a/Documentation/config/merge.txt b/Documentation/config/merge.txt
index e27cc63944..99e83dd36e 100644
--- a/Documentation/config/merge.txt
+++ b/Documentation/config/merge.txt
@@ -4,7 +4,14 @@ merge.conflictStyle::
shows a `<<<<<<<` conflict marker, changes made by one side,
a `=======` marker, changes made by the other side, and then
a `>>>>>>>` marker. An alternate style, "diff3", adds a `|||||||`
- marker and the original text before the `=======` marker.
+ marker and the original text before the `=======` marker. The
+ "merge" style tends to produce smaller conflict regions than diff3,
+ both because of the exclusion of the original text, and because
+ when a subset of lines match on the two sides they are just pulled
+ out of the conflict region. Another alternate style, "zdiff3", is
+ similar to diff3 but removes matching lines on the two sides from
+ the conflict region when those matching lines appear near either
+ the beginning or end of a conflict region.
merge.defaultToUpstream::
If merge is called without any commit argument, merge the upstream
diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt
index d473c9bf38..00e62031be 100644
--- a/Documentation/git-checkout.txt
+++ b/Documentation/git-checkout.txt
@@ -266,8 +266,7 @@ When switching branches with `--merge`, staged changes may be lost.
The same as `--merge` option above, but changes the way the
conflicting hunks are presented, overriding the
`merge.conflictStyle` configuration variable. Possible values are
- "merge" (default) and "diff3" (in addition to what is shown by
- "merge" style, shows the original contents).
+ "merge" (default), "diff3", and "zdiff3".
-p::
--patch::
diff --git a/Documentation/git-merge-file.txt b/Documentation/git-merge-file.txt
index f856032613..7e9093fab6 100644
--- a/Documentation/git-merge-file.txt
+++ b/Documentation/git-merge-file.txt
@@ -70,6 +70,9 @@ OPTIONS
--diff3::
Show conflicts in "diff3" style.
+--zdiff3::
+ Show conflicts in "zdiff3" style.
+
--ours::
--theirs::
--union::
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index e4f3352eb5..e8cecf5a51 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -240,7 +240,8 @@ from the RCS suite to present such a conflicted hunk, like this:
------------
Here are lines that are either unchanged from the common
-ancestor, or cleanly resolved because only one side changed.
+ancestor, or cleanly resolved because only one side changed,
+or cleanly resolved because both sides changed the same way.
<<<<<<< yours:sample.txt
Conflict resolution is hard;
let's go shopping.
@@ -261,16 +262,37 @@ side wants to say it is hard and you'd prefer to go shopping, while the
other side wants to claim it is easy.
An alternative style can be used by setting the "merge.conflictStyle"
-configuration variable to "diff3". In "diff3" style, the above conflict
-may look like this:
+configuration variable to either "diff3" or "zdiff3". In "diff3"
+style, the above conflict may look like this:
------------
Here are lines that are either unchanged from the common
-ancestor, or cleanly resolved because only one side changed.
+ancestor, or cleanly resolved because only one side changed,
<<<<<<< yours:sample.txt
+or cleanly resolved because both sides changed the same way.
Conflict resolution is hard;
let's go shopping.
-|||||||
+||||||| base:sample.txt
+or cleanly resolved because both sides changed identically.
+Conflict resolution is hard.
+=======
+or cleanly resolved because both sides changed the same way.
+Git makes conflict resolution easy.
+>>>>>>> theirs:sample.txt
+And here is another line that is cleanly resolved or unmodified.
+------------
+
+while in "zdiff3" style, it may look like this:
+
+------------
+Here are lines that are either unchanged from the common
+ancestor, or cleanly resolved because only one side changed,
+or cleanly resolved because both sides changed the same way.
+<<<<<<< yours:sample.txt
+Conflict resolution is hard;
+let's go shopping.
+||||||| base:sample.txt
+or cleanly resolved because both sides changed identically.
Conflict resolution is hard.
=======
Git makes conflict resolution easy.
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index a1af21fcef..9da4647061 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -714,9 +714,9 @@ information about the rebased commits and their parents (and instead
generates new fake commits based off limited information in the
generated patches), those commits cannot be identified; instead it has
to fall back to a commit summary. Also, when merge.conflictStyle is
-set to diff3, the apply backend will use "constructed merge base" to
-label the content from the merge base, and thus provide no information
-about the merge base commit whatsoever.
+set to diff3 or zdiff3, the apply backend will use "constructed merge
+base" to label the content from the merge base, and thus provide no
+information about the merge base commit whatsoever.
The merge backend works with the full commits on both sides of history
and thus has no such limitations.
diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt
index 55bde91ef9..5964810caa 100644
--- a/Documentation/git-restore.txt
+++ b/Documentation/git-restore.txt
@@ -92,8 +92,7 @@ in linkgit:git-checkout[1] for details.
The same as `--merge` option above, but changes the way the
conflicting hunks are presented, overriding the
`merge.conflictStyle` configuration variable. Possible values
- are "merge" (default) and "diff3" (in addition to what is
- shown by "merge" style, shows the original contents).
+ are "merge" (default), "diff3", and "zdiff3".
--ignore-unmerged::
When restoring files on the working tree from the index, do
diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt
index 5c438cd505..5c90f76fbe 100644
--- a/Documentation/git-switch.txt
+++ b/Documentation/git-switch.txt
@@ -137,8 +137,7 @@ should result in deletion of the path).
The same as `--merge` option above, but changes the way the
conflicting hunks are presented, overriding the
`merge.conflictStyle` configuration variable. Possible values are
- "merge" (default) and "diff3" (in addition to what is shown by
- "merge" style, shows the original contents).
+ "merge" (default), "diff3", and "zdiff3".
-q::
--quiet::
diff --git a/Documentation/technical/rerere.txt b/Documentation/technical/rerere.txt
index af5f9fc24f..35d4541433 100644
--- a/Documentation/technical/rerere.txt
+++ b/Documentation/technical/rerere.txt
@@ -14,9 +14,9 @@ conflicts before writing them to the rerere database.
Different conflict styles and branch names are normalized by stripping
the labels from the conflict markers, and removing the common ancestor
-version from the `diff3` conflict style. Branches that are merged
-in different order are normalized by sorting the conflict hunks. More
-on each of those steps in the following sections.
+version from the `diff3` or `zdiff3` conflict styles. Branches that
+are merged in different order are normalized by sorting the conflict
+hunks. More on each of those steps in the following sections.
Once these two normalization operations are applied, a conflict ID is
calculated based on the normalized conflict, which is later used by
@@ -42,8 +42,8 @@ get a conflict like the following:
>>>>>>> AC
Doing the analogous with AC2 (forking a branch ABAC2 off of branch AB
-and then merging branch AC2 into it), using the diff3 conflict style,
-we get a conflict like the following:
+and then merging branch AC2 into it), using the diff3 or zdiff3
+conflict style, we get a conflict like the following:
<<<<<<< HEAD
B
diff --git a/builtin/checkout.c b/builtin/checkout.c
index cbf73b8c9f..26ea1c0bdb 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -1517,7 +1517,7 @@ static struct option *add_common_options(struct checkout_opts *opts,
OPT_BOOL(0, "progress", &opts->show_progress, N_("force progress reporting")),
OPT_BOOL('m', "merge", &opts->merge, N_("perform a 3-way merge with the new branch")),
OPT_STRING(0, "conflict", &opts->conflict_style, N_("style"),
- N_("conflict style (merge or diff3)")),
+ N_("conflict style (merge, diff3, or zdiff3)")),
OPT_END()
};
struct option *newopts = parse_options_concat(prevopts, options);