Re: Improving merge of tricky conflicts

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

 



On Thu, Jul 23, 2020 at 06:19:19PM -0700, Junio C Hamano wrote:

> Unfortunately, there is no ">>>>>>>" shown with this code, as $_
> seems to get clobbered before the sub returns, so ...

Ah yeah, thanks for pointing it out (as you might guess I was mainly
looking at the diff output to see if it was broken ;) ).

Your suggested fix is probably what I'd do (I really wish perl localized
$_ automatically when entering new blocks, but I suspect they would
never do so because of compatibility).

> >   my $pre = File::Temp->new;
> >   print $pre @$pre_data;
> 
> I am debating myself if I want to see the base version between these
> two extra diffs.  Perhaps there is no need, as either one of these
> two extra diffs should be sufficient to see what was in the base
> version.

Yeah, I didn't give too much thought to the output, but was afraid of
making it too long and hard to read. In addition to whether to show the
base, I also wondered whether we could omit the "---/+++" header for
each diff. It's mostly boilerplate, and the signal of "hey, this is the
diff between 'base' and 'ours'" could be done on the "|||||||" line
(which also could potentially use a different character to be more
distinct).

I was also tempted to remove the hunk header since the line numbers are
fairly useless. But it is possible for the diff to have multiple hunks,
and you'd still want to show that.

My big challenge now will be remembering to try to use this next time I
run into a conflict that could be helped by it. :)

-Peff



[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