From: Johannes Sixt <j6t@kdbg.org>
To: phillip.wood@dunelm.org.uk, Konstantin Kharlamov <hi-angel@yandex.ru>
Cc: git@vger.kernel.org
Subject: Re: Do not raise conflict when a code in a patch was already added
Date: Mon, 20 Aug 2018 21:22:46 +0200 [thread overview]
Message-ID: <0d36d185-23d5-a656-67dd-5df86abed3e9@kdbg.org> (raw)
In-Reply-To: <ab5021a9-6980-b96c-9d51-cc301844f2af@talktalk.net>
Am 20.08.2018 um 19:40 schrieb Phillip Wood:
> On 20/08/2018 11:22, Konstantin Kharlamov wrote:
>> It's spectacular, that content of one of inserted conflict markers is
>> empty, so all you have to do is to remove the markers, and use `git add`
>> on the file, and then `git rebase --continue`
>>
>> Its a lot of unncessary actions, git could just figure that the code it
>> sees in the patch is already there, being a part of another commit.
>
> If there are conflict markers where one side is empty it means that some
> lines from the merge base (which for a rebase is the parent of the
> commit being picked) have been deleted on one side and modified on the
> other. Git cannot know if you want to use the deleted version or the
> modified version.
There's another possibility (and I think it is what happens actually in
Konstantin's case): When one side added lines 1 2 and the other side
added 1 2 3, then the actual conflict is << 1 2 == 1 2 3 >>, but our
merge code is able to move the identical part out of the conflicted
section: 1 2 << == 3 >>. But this is just a courtesy for the user; the
real conflict is the original one. Without this optimization, the work
to resolve the conflict would be slightly more arduous.
-- Hannes
next prev parent reply other threads:[~2018-08-20 19:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-20 10:22 Do not raise conflict when a code in a patch was already added Konstantin Kharlamov
2018-08-20 17:40 ` Phillip Wood
2018-08-20 19:22 ` Johannes Sixt [this message]
2018-08-21 9:37 ` Konstantin Kharlamov
2018-08-21 12:10 ` Igor Djordjevic
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=0d36d185-23d5-a656-67dd-5df86abed3e9@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=hi-angel@yandex.ru \
--cc=phillip.wood@dunelm.org.uk \
/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).