All of lore.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Subject: [PATCH] Documentation: make 3-way merge warning more generic
Date: Sat,  1 Apr 2017 13:31:24 +0000	[thread overview]
Message-ID: <20170401133124.10479-1-sandals@crustytoothpaste.net> (raw)

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@crustytoothpaste.net>
---

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


             reply	other threads:[~2017-04-01 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01 13:31 brian m. carlson [this message]
2017-04-01 19:26 ` [PATCH] Documentation: make 3-way merge warning more generic Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170401133124.10479-1-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.