git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Konstantin Kharlamov <hi-angel@yandex.ru>
To: Johannes Sixt <j6t@kdbg.org>, phillip.wood@dunelm.org.uk
Cc: git@vger.kernel.org
Subject: Re: Do not raise conflict when a code in a patch was already added
Date: Tue, 21 Aug 2018 12:37:54 +0300	[thread overview]
Message-ID: <e5f65c19-0f49-d48e-c600-7dfcd95f3218@yandex.ru> (raw)
In-Reply-To: <0d36d185-23d5-a656-67dd-5df86abed3e9@kdbg.org>



On 20.08.2018 22:22, Johannes Sixt wrote:
> 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.

Yeah, thanks, that's what happens. And I'm wondering, is it really 
needed to raise a conflict there? Would it be worth to just apply the 
line "3", possibly with a warning or an interactive question to user 
(apply/raise) that identical parts were ignored?

  reply	other threads:[~2018-08-21  9:45 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
2018-08-21  9:37     ` Konstantin Kharlamov [this message]
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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=e5f65c19-0f49-d48e-c600-7dfcd95f3218@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).