[PATCH] Documentation: make 3-way merge warning more generic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The documentation for merge strategies noted that if a change was
reverted on only one branch of a merge, the resultant merge would
contain the change.  However, similar surprising behavior can occur
where cherry-picking only one commit from a series to the other branch
can cause conflicts.

Adjust the text to state in the first sentence that only the heads and
the merge base are considered for three-way merge, instead of hiding
this in the second sentence after introducing a scenario which might not
apply to the user.  This makes it easier for users to understand by
first introducing the general rule (which applies to many scenarios),
and only then providing a specific example.

Signed-off-by: brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx>
---

I ran into this scenario with a co-worker who is a fairly advanced Git
user.  He created a series of five commits that modified a file on our
development branch and requested the cherry-pick of one of those onto
our maintenance branch.  When we merged the maintenance branch into the
development branch, he was surprised that there were conflicts.  He
expected Git to realize that the commit was already present and ignore
it.

I pointed out the documentation to him, but realized that it didn't
cover this case well, so I decided to reword it such that it covers this
case a little better, as well as addressing the original issue.

Feedback on how I did in that regard would be welcome.

 Documentation/merge-strategies.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/merge-strategies.txt b/Documentation/merge-strategies.txt
index 2eb92b9327..54da2ffa33 100644
--- a/Documentation/merge-strategies.txt
+++ b/Documentation/merge-strategies.txt
@@ -123,9 +123,9 @@ subtree::
 	ancestor tree.
 
 With the strategies that use 3-way merge (including the default, 'recursive'),
-if a change is made on both branches, but later reverted on one of the
-branches, that change will be present in the merged result; some people find
-this behavior confusing.  It occurs because only the heads and the merge base
-are considered when performing a merge, not the individual commits.  The merge
-algorithm therefore considers the reverted change as no change at all, and
-substitutes the changed version instead.
+only the heads and the merge base are considered when performing a merge, not
+the individual commits.  This means that if a change is made on both branches,
+but later reverted on one of the branches, that change will be present in the
+merged result; some people find this behavior confusing.  The merge algorithm
+considers the reverted change as no change at all, and substitutes the changed
+version instead.
-- 
2.12.2.564.g063fe858b8




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]