From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Olivier Certner Newsgroups: gmane.emacs.bugs 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 Message-ID: <1855192.vslOlgHxSZ@ravel> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart5740219.Zv9zXsTiuT" Content-Transfer-Encoding: 7Bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3519"; mail-complaints-to="usenet@ciao.gmane.io" To: 59182@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 10 19:30:30 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1otCJp-0000gj-Pl for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Nov 2022 19:30:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1otCJR-0003XO-Na; Thu, 10 Nov 2022 13:30:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otCJP-0003Ud-Em for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 13:30:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1otCJP-0001fT-3Z for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 13:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1otCJO-00008i-K6 for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 13:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Olivier Certner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Nov 2022 18:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59182 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1668104960462 (code B ref -1); Thu, 10 Nov 2022 18:30:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Nov 2022 18:29:20 +0000 Original-Received: from localhost ([127.0.0.1]:44351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otCIi-00007N-6q for submit@debbugs.gnu.org; Thu, 10 Nov 2022 13:29:20 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43548) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otCIg-00007G-H7 for submit@debbugs.gnu.org; Thu, 10 Nov 2022 13:29:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otCIg-0002Ya-CS for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 13:29:18 -0500 Original-Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1otCIb-0007v0-Eg for bug-gnu-emacs@gnu.org; Thu, 10 Nov 2022 13:29:18 -0500 Original-Received: from ravel.localnet (unknown [109.210.33.132]) (Authenticated sender: ocert.dev@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id C32D8780310 for ; Thu, 10 Nov 2022 19:29:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1668104949; bh=D0CKz3toqMNgxhn77ZZXHf6COef0Yo8WGeHr5wW8JQ4=; h=From:To:Subject:Date:From; b=XMGBr9Myw0ruSLmMFi11x+9GYC2LF3nQQIPwOGWl03JdcZQ5qZtp6WmEyw9YIAVcr 6IXKgX09BH1cTF6lNtInbj60a6fyX4o+IoOLa4QINykI8Ul7KhteJYO4vqjyPecJKR o9PT91JcAaQGgG0soaDFgeZourCOaiD3j7ThQ4oDzv3bTTvX1kBBK/rRiG6/eumBVK 7vAyYAJNYqEsxXM78oZMh6xtnRQ/GdR/qX7u79GWlm6RXDy3Sm8zkh+8Qm6zs91lM4 KHrlC9pQWOKUJzLLqF6r2A2ox8ocp5RyLGKxpXu7m4NdQJ30phCrP+w/EEVs5M/CTO 4Du43VJ4qNtmQ== Received-SPF: pass client-ip=2a01:e0c:1:1599::15; envelope-from=ocert.dev@free.fr; helo=smtp6-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:247533 Archived-At: This is a multi-part message in MIME format. --nextPart5740219.Zv9zXsTiuT Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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 --nextPart5740219.Zv9zXsTiuT Content-Disposition: attachment; filename="local.txt" Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; name="local.txt" 4 5 1 2 3 --nextPart5740219.Zv9zXsTiuT Content-Disposition: attachment; filename="ancestor.txt" Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; name="ancestor.txt" 1 2 3 4 5 6 --nextPart5740219.Zv9zXsTiuT Content-Disposition: attachment; filename="other.txt" Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8"; name="other.txt" 4 5 6 1 2 --nextPart5740219.Zv9zXsTiuT--