GNU bug report logs - #59182
28.1; ediff: Merges with ancestor: Fix computation of hunks and proposed merge

Previous Next

Package: emacs;

Reported by: Olivier Certner <ocert.dev <at> free.fr>

Date: Thu, 10 Nov 2022 18:30:02 UTC

Severity: normal

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59182 in the body.
You can then email your comments to 59182 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#59182; Package emacs. (Thu, 10 Nov 2022 18:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Olivier Certner <ocert.dev <at> free.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 10 Nov 2022 18:30:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Olivier Certner <ocert.dev <at> free.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.1;
 ediff: Merges with ancestor: Fix computation of hunks and proposed
 merge
Date: Thu, 10 Nov 2022 19:29:09 +0100
[Message part 1 (text/plain, inline)]
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
[local.txt (text/plain, attachment)]
[ancestor.txt (text/plain, attachment)]
[other.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59182; Package emacs. (Thu, 10 Nov 2022 18:36:01 GMT) Full text and rfc822 format available.

Message #8 received at 59182 <at> debbugs.gnu.org (full text, mbox):

From: Olivier Certner <ocert.dev <at> free.fr>
To: 59182 <at> debbugs.gnu.org
Subject: Proposed fix
Date: Thu, 10 Nov 2022 19:35:28 +0100
[Message part 1 (text/plain, inline)]
On top of emacs-28 branch (49a14c4375ce4c2c).

The fix is "minimal", in the sense that it doesn't try to refactor/modify unrelated code.

-- 
Olivier Certner
[0001-ediff-Merges-with-ancestor-Fix-computation-of-hunks-.patch (text/x-patch, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 17 Nov 2022 09:43:02 GMT) Full text and rfc822 format available.

Notification sent to Olivier Certner <ocert.dev <at> free.fr>:
bug acknowledged by developer. (Thu, 17 Nov 2022 09:43:02 GMT) Full text and rfc822 format available.

Message #13 received at 59182-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Olivier Certner <ocert.dev <at> free.fr>
Cc: 59182-done <at> debbugs.gnu.org
Subject: Re: bug#59182: Proposed fix
Date: Thu, 17 Nov 2022 11:41:53 +0200
> From: Olivier Certner <ocert.dev <at> free.fr>
> Date: Thu, 10 Nov 2022 19:35:28 +0100
> 
> On top of emacs-28 branch (49a14c4375ce4c2c).
> 
> The fix is "minimal", in the sense that it doesn't try to refactor/modify unrelated code.

Thanks, I've now installed this on the master branch, and I'm closing
the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 15 Dec 2022 12:24:15 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.