From: Jeff King <peff@peff.net>
To: KES <kes-kes@yandex.ua>
Cc: git <git@vger.kernel.org>
Subject: Re: Improving auto conflict resolving while merge
Date: Tue, 8 Sep 2015 03:06:46 -0400 [thread overview]
Message-ID: <20150908070645.GH26331@sigill.intra.peff.net> (raw)
In-Reply-To: <856611441646146@web13j.yandex.ru>
On Mon, Sep 07, 2015 at 08:15:46PM +0300, KES wrote:
> 1. git clone https://github.com/KES777/Plack
> [...]
> At this point I have same changes on master and branch.
> master head is d095870
> branch head is a3db36a
> fork point is 0a5ff84
I tried re-merging d095870 and a3db36a. I think what is happening is
that even though you have many similar hunks near each, there are still
some differences in the area, and they are close enough that the merge
isn't sure what is right. We err on the side of conservatism with
conflicts, because it's hard to say what is dependent and what is not.
For example, if you have the content:
foo();
bar();
baz();
and one side makes it:
foo();
x = 1;
bar();
baz();
and the other side does:
foo();
bar();
y = 2;
baz();
you _could_ argue that those changes are independent (and write a merge
algorithm that silently merges them). They're touching two different
lines, and doing two different things. But it's close enough that
there's a good chance the two need to be reconciled, and a human should
at least take a look.
I think what further confuses things in your case is that the content
added by the two sides contains a lot of similar lines (because of the
cherry-pick), and the default "merge" conflict-markers try to shrink the
size of the conflicts.
Try running:
git config merge.conflictstyle diff3
and re-doing the merge. It will give you a much better sense of how git
is breaking down the hunks (because it does not try to shrink the
conflicts, and because it shows the base content for each conflict).
-Peff
next prev parent reply other threads:[~2015-09-08 7:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 17:15 Improving auto conflict resolving while merge KES
2015-09-08 7:06 ` Jeff King [this message]
2015-09-09 0:08 ` Re[2]: " Eugen Konkov
2015-09-08 22:03 ` Jeff King
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=20150908070645.GH26331@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=kes-kes@yandex.ua \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).