Re: Improving merge of tricky conflicts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 23, 2020 at 8:27 AM Jeff King <peff@xxxxxxxx> wrote:
>
> On Wed, Jul 22, 2020 at 10:26:04AM -0700, Junio C Hamano wrote:
>
> > > The big downside here, of course, is that it's showing the diff for the
> > > whole file, not just one hunk (on the other hand, I often find the
> > > trickiest conflicts are ones where the changes unexpectedly span
> > > multiple hunks).
> >
> > Yup, I often find myself comparing the base part (lines between |||
> > and ===) with our part (lines between <<< and |||) and their part
> > (lines between === and >>>) while looking at the diff3 output to see
> > what unique change each side did, in order to come up with a
> > conflict resolution.
> >
> > I do this often enough to wonder if I should write a small "filter"
> > that I can pipe a whole "diff3" <<< ... ||| ... === ... >>> region
> > to and convert it into to diffs, but not often enough to motivate
> > me to actually write one ;-).
>
> I would definitely have found that useful before (usually when one side
> made a tiny one-line change and the other side deleted or drastically
> changed a huge chunk).

FYI, I added something similar to Mercurial recently. Instead of two
diffs, it shows one snapshot and one diff. See
https://phab.mercurial-scm.org/D9551 for details. I've used it for a
few weeks and it seems to be working pretty well. The drawback is
mostly when you want to keep the side with the diff and ignore the
other side, since you'll then have to drop the lines prefixed with "-"
and then enter column-selection mode or something and delete the first
character on each remaining line.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux