git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: feature suggestion: optimize common parts for checkout --conflict=diff3

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 7, 2013, 18:21 UTC
Message-ID
<7vk3pjm5of.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v1ubrnmtu.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> 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
;-)
Show 13 quoted lines
> 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.

	
Previous: Junio C Hamano
Message 24 of 24 in “feature suggestion: optimize common parts for checkout --conflict=diff3”
  1. Uwe Kleine-KönigMar 6, 2013
  2. Antoine PelisseMar 6, 2013
  3. Antoine PelisseMar 6, 2013
  4. Jeff KingMar 6, 2013
  5. xdiff: implement a zealous diff3Uwe Kleine-König, Mar 6, 2013
  6. Jeff KingMar 6, 2013
  7. Junio C HamanoMar 6, 2013
  8. Jeff KingMar 6, 2013
  9. Junio C HamanoMar 6, 2013
  10. Jeff KingMar 6, 2013
  11. Junio C HamanoMar 6, 2013
  12. Jeff KingMar 7, 2013
  13. Uwe Kleine-KönigMar 6, 2013
  14. Junio C HamanoMar 6, 2013
  15. Jeff KingMar 7, 2013
  16. Junio C HamanoMar 7, 2013
  17. Jeff KingMar 7, 2013
  18. Junio C HamanoMar 7, 2013
  19. Jeff KingMar 7, 2013
  20. Jeff KingApr 4, 2013
  21. Uwe Kleine-KönigApr 4, 2013
  22. Jeff KingApr 4, 2013
  23. Junio C HamanoApr 4, 2013
  24. Junio C HamanoMar 7, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.