RE: [PATCH 1/2] xdiff: implement a zealous diff3, or "zdiff3"

From
Felipe Contreras <hidden>
Date
2021-06-15 09:40:34
Reply to
Elijah Newren via GitGitGadget, 2021-06-15
Elijah Newren via GitGitGadget wrote:
From: Elijah Newren <redacted>

"zdiff3" is identical to ordinary diff3 except that it allows compaction
of common lines on the two sides of history at the beginning or end of
the conflict hunk.
That was not the main reason behind zdiff3.

The whole point of zdiff3 was to have something closer to the "merge"
style, even if not technically correct.

Your proposal is better than diff3 in that respect, but worse than Uwe's
zdiff3.

If you have this:

  l  b  r
  =  =  =
  A  A  A

  B     b
  C     C
  D     D
  E     E
  F     F
  I     i

merge will output this:

  A

  <<<<<<< l
  B
  =======
  b
  >>>>>>> r
  C
  D
  E
  F
  <<<<<<< l
  I
  =======
  i
  >>>>>>> r

This is simple, and useful.

diff3 will output this:

  A
  <<<<<<< l

  B
  C
  D
  E
  F
  I
  ||||||| b
  =======

  b
  C
  D
  E
  F
  i
  >>>>>>> r

Not very friendly.

Your zdiff3:

  A

  <<<<<<< l
  B
  C
  D
  E
  F
  I
  ||||||| b
  =======
  b
  C
  D
  E
  F
  i
  >>>>>>> r

Just marginally better.

Uwe's zdiff3:

  A

  <<<<<<< l
  B
  ||||||| b
  =======
  b
  >>>>>>> r
  C
  D
  E
  F
  <<<<<<< l
  I
  ||||||| b
  =======
  i
  >>>>>>> r

In my view of all the *diff3's, Uwe's version is the most useful.

-- 
Felipe Contreras
Thread (36 messages) 36 messages, 8 authors, last reply 2021-12-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help