From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Antoine Pelisse" <apelisse@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
git <git@vger.kernel.org>,
kernel@pengutronix.de
Subject: Re: feature suggestion: optimize common parts for checkout --conflict=diff3
Date: Thu, 07 Mar 2013 10:21:52 -0800 [thread overview]
Message-ID: <7vk3pjm5of.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v1ubrnmtu.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 07 Mar 2013 09:26:05 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> You could make it "1234<AB|5=AX><C|=C><DE|6=YE>789", and that is
> technically correct (what there were in the shared original for the
> conflicted part is 5 and then 6), but the representation pretends
> that it knows more than there actually is information, which may be
> somewhat misleading. All these three are equally plausible split of
> the original "56":
>
> 1234<AB|=AX><C|=C><DE|56=YE>789
> 1234<AB|5=AX><C|=C><DE|6=YE>789
> 1234<AB|56=AX><C|=C><DE|=YE>789
>
> and picking one over others would be a mere heuristic. All three
> are technically correct representations and it is just the matter of
> which one is the easiest to understand. So, this is the kind of
> "misleading but not incorrect".
I forgot to say that youu could even do something silly like:
1234<AB|=AX><C|56=C><DE|=YE>789
;-)
> In all these cases, the middle part would look like this:
>
> <<<<<<< ours
> C
> ||||||| base
> =======
> C
> >>>>>>> theirs
>
> in order to honor the explicit "I want to view all three versions to
> examine the situation" aka "--conflict=diff3" option. We cannot
> reduce it to just "C". That will make it "not just misleading but
> is actively wrong".
I also forgot to say that the issue is the same to reduce
1234<AB|=AX><C|=C><DE|56=YE>789
to
1234<A|=A><B|=X><C|=C><D|56=Y><E|=E>789
which is unconditionally correct and then for all x reduce <x|=x> to
x, yielding
1234A<B|=X>C<D|56=Y>E789
which your zealous-diff3 would do. So squashing that <C|=C> in the
middle would be consistent if you take the zealous-diff3 route.
But again, that is discarding the information of the original, which
the user explicitly asked from "diff3 -m", i.e. show all three to
examine the situation. If the user wants to operate _without_ the
original, the user would have asked for "RCS merge" style output, so
I am still not sure if that is a sensible mode of operation for diff3
to begin with.
prev parent reply other threads:[~2013-03-07 18:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 15:05 feature suggestion: optimize common parts for checkout --conflict=diff3 Uwe Kleine-König
2013-03-06 18:27 ` Antoine Pelisse
2013-03-06 19:26 ` Antoine Pelisse
2013-03-06 20:03 ` Jeff King
2013-03-06 20:36 ` [PATCH] xdiff: implement a zealous diff3 Uwe Kleine-König
2013-03-06 20:46 ` Jeff King
2013-03-06 20:40 ` feature suggestion: optimize common parts for checkout --conflict=diff3 Junio C Hamano
2013-03-06 20:54 ` Jeff King
2013-03-06 21:09 ` Junio C Hamano
2013-03-06 21:21 ` Jeff King
2013-03-06 21:50 ` Junio C Hamano
2013-03-07 1:02 ` Jeff King
2013-03-06 21:31 ` Uwe Kleine-König
2013-03-06 21:32 ` Junio C Hamano
2013-03-07 8:04 ` Jeff King
2013-03-07 17:26 ` Junio C Hamano
2013-03-07 18:01 ` Jeff King
2013-03-07 18:40 ` Junio C Hamano
2013-03-07 18:50 ` Jeff King
2013-04-04 20:33 ` Jeff King
2013-04-04 20:49 ` Uwe Kleine-König
2013-04-04 20:54 ` Jeff King
2013-04-04 21:19 ` Junio C Hamano
2013-03-07 18:21 ` Junio C Hamano [this message]
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=7vk3pjm5of.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=apelisse@gmail.com \
--cc=git@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=peff@peff.net \
--cc=u.kleine-koenig@pengutronix.de \
/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).