bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#59182: 28.1; ediff: Merges with ancestor: Fix computation of hunks a


From: Olivier Certner
Subject: bug#59182: 28.1; ediff: Merges with ancestor: Fix computation of hunks and proposed merge
Date: Thu, 10 Nov 2022 19:29:09 +0100

Hunks are not computed correctly because the diff3 command is
invoked with arguments in an incorrect order.  The correct order is
the local file first, the base (or "ancestor") second and the other
file third. 

This erroneous behavior has two consequences.  First, the
output of diff3 would change, since it tries to merge chunks according
to maximal matches between the second and first files, and the second
and third files.  Second, ediff, more precisely, `ediff-do-merge',
would consequently try to merge the reverse of the changes from the
base to the other file, leading to a hard to understand merge result in
some cases.

To see the effect on a simple example, consider what
`ediff-merge-with-ancestors` suggests on the three files attached (run
`ediff-merge-with-ancestor' with file A being 'local.txt', file B being
'other.txt' and file C being 'ancestor.txt').

I noticed this problem on a very hairy merge that I can't reproduce here.

Fix to be attached as soon as the bug is created.

-- 
Olivier Certner

Attachment: local.txt
Description: Text document

Attachment: ancestor.txt
Description: Text document

Attachment: other.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]