Re: [PATCH 1/2] xdiff: implement a zealous diff3, or "zdiff3"
- From
Sergey Organov <sorganov@gmail.com>
- Date
- Jun 15, 2021, 18:50 UTC
- Message-ID
- <8735tj2c9n.fsf@osv.gnss.ru>
- In-Reply-To
- <CABPp-BHjXf88MQYX8Fd3WGw2WfbMKAdAD-MEViiB7oTtQbfTyw@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 75 quoted lines
> On Tue, Jun 15, 2021 at 2:40 AM Felipe Contreras > <felipe.contreras@gmail.com> wrote: >> >> Elijah Newren via GitGitGadget wrote: >> > From: Elijah Newren <newren@gmail.com> >> > >> > "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.
For me it's friendly enough. One key-press in Emacs and I get:
--- upper/xx.txt +++ lower/xx.txt
@@ -1,7 +1,7 @@ -B +b C D E F -I +i In a separate window, that is roughly what you've get in the "merge" output in the first place, but even more compact. My point is that once Git provides enough context, a good interactive tool will do the rest just fine, beneficial to the end-user. -- Sergey Organov