From unknown Sat Jun 21 03:31:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25010: 26.0.50; epatch might parse wrongly a file name Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Nov 2016 06:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25010 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 25010@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.147996869216610 (code B ref -1); Thu, 24 Nov 2016 06:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Nov 2016 06:24:52 +0000 Received: from localhost ([127.0.0.1]:39872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9nSm-0004Jq-Gx for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9nSl-0004Jc-0y for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9nSe-0000ji-Gn for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c9nSe-0000je-DR for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9nSd-0000yw-1k for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2016 01:24:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9nSY-0000ga-4y for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2016 01:24:43 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:36678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9nSX-0000ft-Tf for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2016 01:24:38 -0500 Received: by mail-pg0-x243.google.com with SMTP id x23so2673179pgx.3 for ; Wed, 23 Nov 2016 22:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=jZMt1hkRZx3Bza0C3vn9SnGQOsznF04KaLSPtw/xabo=; b=ah2yF7d1qgJokqPGN9Zumpz1ZPBuuAvwc2WNvRYKgpHexvj/NZSgnGoWy5wzO6N3hU 5jjqSRproI38J9Ss0+ydFUFvxOqLAjvsUA6Kli5XoNGX4xodGqjtZxFiSxJaTJ+2Mqjj kJSFbVp18ZLC4Txe10ha9YZdQZgQ7OUD8Ul2tQKIr82zA8mNsRVbD090frfQBhbErJVD yZmAKaEId+4oh5UlWN5gQOw+AXDKQDcUN/NJ5UdDsPQp0S/ppKVKyDdU2bizgJfxXVTE 3G+/w3rFbMPMYPyLbLK93RUo9ENscnMBt9P+HNMPMH2rTHDquyAJ/FFi7B3KAZYtpdUL nvpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=jZMt1hkRZx3Bza0C3vn9SnGQOsznF04KaLSPtw/xabo=; b=KrC7TvyPdkDeDjGDian0Nr8pHGAIEjvA6N35KcWVrlAMr6E7R6LYvrpXecGKiCdExT KfcOK8YJZ+HdsUdnYUuVDxJuVL7rdWO8+S/Prz9Utld8gZ7vxufEh5Eb/APiUXohAM25 Hh6fHKUAA8KNluZdAXjXU5/H4ESPKNHXcqCU81rlDjvzBWNXVMJpkvBxG9L0bSu7ELmR GQnvLjOIs6cClkdGi6r2bIhUbxva85szYmPY9La9zz2CBkDyvJASGRRwMem78+cgtO+I NpdQNxamdpHF2TymTn5JIv2c+ZfsY5yjFLw4EVbGIADsRRJ6+tw1UJPdH31unzmn8YsX ysdQ== X-Gm-Message-State: AKaTC00qsIh4kAwDxXJD+XuUBLFEvjczdh04JVx7PKjXfC8qLYL9cMuuhsM9n7z5C/JdiQ== X-Received: by 10.99.141.193 with SMTP id z184mr1442106pgd.23.1479968676457; Wed, 23 Nov 2016 22:24:36 -0800 (PST) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id z9sm57019004pfd.29.2016.11.23.22.24.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Nov 2016 22:24:36 -0800 (PST) From: Tino Calancha Date: Thu, 24 Nov 2016 15:24:31 +0900 Message-ID: <871sy1s8dc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) That's why sometimes while we are applying a multi-patch we see a message similar as: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ediff has inferred that /home/foo/emacs/ediff-mult.el /home/foo/emacs/ediff-mult.el @@ are two possible targets for this patch. However, these files do not exist. Please enter an alternative patch target ... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Note that it mentions 2 targets, but it shows the same file twice. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From 2cc7a050a062cd3ea6051a4775001c8d10bc0aa6 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Thu, 24 Nov 2016 15:11:51 +0900 Subject: [PATCH] ediff-context-diff-label-regexp: Detect the end of second file * lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp): Skip '\n' in file names (Bug#25010). * test/lisp/vc/ediff-ptch-tests.el: New file. (ibuffer-test-bug25010): Add test for Bug#25010. --- lisp/vc/ediff-ptch.el | 11 +++++----- test/lisp/vc/ediff-ptch-tests.el | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 test/lisp/vc/ediff-ptch-tests.el diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 6a07f80..6e8e947 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -120,11 +120,12 @@ ediff-patch-default-directory ;; This context diff does not recognize spaces inside files, but removing ' ' ;; from [^ \t] breaks normal patches for some reason (defcustom ediff-context-diff-label-regexp - (concat "\\(" ; context diff 2-liner - "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)" - "\\|" ; unified format diff 2-liner - "^--- +\\([^ \t]+\\).*\n\\+\\+\\+ +\\([^ \t]+\\)" - "\\)") + (let ((stuff "\\([^ \t\n]+\\)")) + (concat "\\(" ; context diff 2-liner + "^\\*\\*\\* +" stuff "[^*]+[\t ]*\n--- +" stuff + "\\|" ; unified format diff 2-liner + "^--- +" stuff ".*\n\\+\\+\\+ +" stuff + "\\)")) "Regexp matching filename 2-liners at the start of each context diff. You probably don't want to change that, unless you are using an obscure patch program." diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el new file mode 100644 index 0000000..e201dfe --- /dev/null +++ b/test/lisp/vc/ediff-ptch-tests.el @@ -0,0 +1,43 @@ +;;; ediff-ptch-tests.el --- Tests for ediff-ptch.el + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; Author: Tino Calancha + +;; This program is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see `http://www.gnu.org/licenses/'. + +;;; Code: + +(require 'ert) +(require 'ediff-ptch) + +(ert-deftest ibuffer-test-bug25010 () + "Test for http://debbugs.gnu.org/25010 ." + :expected-result :failed + (with-temp-buffer + (insert "diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el +index 6a07f80..6e8e947 100644 +--- a/lisp/vc/ediff-ptch.el ++++ b/lisp/vc/ediff-ptch.el +@@ -120,11 +120,12 @@ ediff-patch-default-directory +") + (goto-char (point-min)) + (let ((filename + (progn + (re-search-forward ediff-context-diff-label-regexp nil t) + (match-string 1)))) + (should-not (string-suffix-p "@@" filename))))) + +(provide 'ediff-ptch-tests) +;;; ediff-ptch-tests.el ends here -- 2.10.2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.3) of 2016-11-24 Repository revision: dfc5b0f65531ef71cbd2c0cc956c246ea4239612 From unknown Sat Jun 21 03:31:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tino Calancha Subject: bug#25010: closed (Re: bug#25010: 26.0.50; epatch might parse wrongly a file name) Message-ID: References: <87lgvsj5te.fsf@gmail.com> <871sy1s8dc.fsf@gmail.com> X-Gnu-PR-Message: they-closed 25010 X-Gnu-PR-Package: emacs Reply-To: 25010@debbugs.gnu.org Date: Wed, 07 Dec 2016 12:14:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1481112842-7436-1" This is a multi-part message in MIME format... ------------=_1481112842-7436-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25010: 26.0.50; epatch might parse wrongly a file name which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25010@debbugs.gnu.org. --=20 25010: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25010 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1481112842-7436-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25010-done) by debbugs.gnu.org; 7 Dec 2016 12:13:23 +0000 Received: from localhost ([127.0.0.1]:58904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEb6B-0001uo-2o for submit@debbugs.gnu.org; Wed, 07 Dec 2016 07:13:23 -0500 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEb69-0001ua-8m for 25010-done@debbugs.gnu.org; Wed, 07 Dec 2016 07:13:21 -0500 Received: by mail-pg0-f48.google.com with SMTP id f188so161049932pgc.3 for <25010-done@debbugs.gnu.org>; Wed, 07 Dec 2016 04:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=lMkYwPyr8RTberQKZoUUtr4sAbSKdXecfByUHjwHghM=; b=C3yN4n+8hqBHPRLUES0DHT4FFyMvRGotEjdOLG8FFYyx6GSix0wB4lNmnJwUk6Ou/A efge8iYLOUO1lqcoXj45TdU6l0N30Ik6MxIwc6nAfFZm9CH4qZXFPmXq1ux4mjI2542s Fe1P+iRWKR5SVS2zr+R01UAnYp6i62/hKA8NvMVgLdIB0mawYY3PCE/xKGIGj58F+QVK gXiI+xrfdzPDlfrYxZAxqAYcC8dBm+1+whu3kdxjN90lTCpYbsKlFl3QAkQPPAzuHtIY 8sTr4XycC7iTNqGePjuJ4tui678eZrsXW2awiaApLl/zzSPfETWp24acT3DnhF4KV3I1 zOvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=lMkYwPyr8RTberQKZoUUtr4sAbSKdXecfByUHjwHghM=; b=UxC9nRHv7XsSEjMONHbkU0wYSIWlncbc0TGbtuyxgAXSB1TWxCyr3pnoEFjLcvGMQ6 nWDXZFhYjcQfF8fggs+GkPT3eAUusyX3PByf5FEVk7Pr1SEvk3aBHpJG7rPbc+m8VNww l2moQl8kOnyZGIYwnjMOZ4UfuxK4dDOMjLHaBQUVjM8XA/avSe7oAWTobWO/LgbF7h4b jHhbYS/0/UGsKMdjRODr40Ej/spo1LjkXkDNyKgfEtNAD36fIqp/JMks0fEUtxD0I2z6 S7gV/P07Gb26QrOArGaDt7XO3fvb2E6aVvu9TsKCTYe1nknj6+9PNL8NEDPjGV+K5nXu w+lw== X-Gm-Message-State: AKaTC00OvqEUKtyGmYMj17i0P94JEw8fZeHNnkffYQw/fRr3txz8LOUcEZ/B48zKqwM+fQ== X-Received: by 10.84.215.158 with SMTP id l30mr22062024pli.132.1481112795238; Wed, 07 Dec 2016 04:13:15 -0800 (PST) Received: from calancha-pc (pl676.nas813.p-iwate.nttpc.ne.jp. [124.154.237.164]) by smtp.gmail.com with ESMTPSA id p14sm9697117pfl.74.2016.12.07.04.13.13 for <25010-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Dec 2016 04:13:14 -0800 (PST) From: Tino Calancha To: 25010-done@debbugs.gnu.org Subject: Re: bug#25010: 26.0.50; epatch might parse wrongly a file name References: <871sy1s8dc.fsf@gmail.com> Date: Wed, 07 Dec 2016 21:13:01 +0900 In-Reply-To: <871sy1s8dc.fsf@gmail.com> (Tino Calancha's message of "Thu, 24 Nov 2016 15:24:31 +0900") Message-ID: <87lgvsj5te.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25010-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Pushed fix to master branch as commit 2c49705. ------------=_1481112842-7436-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Nov 2016 06:24:52 +0000 Received: from localhost ([127.0.0.1]:39872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9nSm-0004Jq-Gx for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c9nSl-0004Jc-0y for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9nSe-0000ji-Gn for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c9nSe-0000je-DR for submit@debbugs.gnu.org; Thu, 24 Nov 2016 01:24:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9nSd-0000yw-1k for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2016 01:24:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9nSY-0000ga-4y for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2016 01:24:43 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:36678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9nSX-0000ft-Tf for bug-gnu-emacs@gnu.org; Thu, 24 Nov 2016 01:24:38 -0500 Received: by mail-pg0-x243.google.com with SMTP id x23so2673179pgx.3 for ; Wed, 23 Nov 2016 22:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version; bh=jZMt1hkRZx3Bza0C3vn9SnGQOsznF04KaLSPtw/xabo=; b=ah2yF7d1qgJokqPGN9Zumpz1ZPBuuAvwc2WNvRYKgpHexvj/NZSgnGoWy5wzO6N3hU 5jjqSRproI38J9Ss0+ydFUFvxOqLAjvsUA6Kli5XoNGX4xodGqjtZxFiSxJaTJ+2Mqjj kJSFbVp18ZLC4Txe10ha9YZdQZgQ7OUD8Ul2tQKIr82zA8mNsRVbD090frfQBhbErJVD yZmAKaEId+4oh5UlWN5gQOw+AXDKQDcUN/NJ5UdDsPQp0S/ppKVKyDdU2bizgJfxXVTE 3G+/w3rFbMPMYPyLbLK93RUo9ENscnMBt9P+HNMPMH2rTHDquyAJ/FFi7B3KAZYtpdUL nvpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=jZMt1hkRZx3Bza0C3vn9SnGQOsznF04KaLSPtw/xabo=; b=KrC7TvyPdkDeDjGDian0Nr8pHGAIEjvA6N35KcWVrlAMr6E7R6LYvrpXecGKiCdExT KfcOK8YJZ+HdsUdnYUuVDxJuVL7rdWO8+S/Prz9Utld8gZ7vxufEh5Eb/APiUXohAM25 Hh6fHKUAA8KNluZdAXjXU5/H4ESPKNHXcqCU81rlDjvzBWNXVMJpkvBxG9L0bSu7ELmR GQnvLjOIs6cClkdGi6r2bIhUbxva85szYmPY9La9zz2CBkDyvJASGRRwMem78+cgtO+I NpdQNxamdpHF2TymTn5JIv2c+ZfsY5yjFLw4EVbGIADsRRJ6+tw1UJPdH31unzmn8YsX ysdQ== X-Gm-Message-State: AKaTC00qsIh4kAwDxXJD+XuUBLFEvjczdh04JVx7PKjXfC8qLYL9cMuuhsM9n7z5C/JdiQ== X-Received: by 10.99.141.193 with SMTP id z184mr1442106pgd.23.1479968676457; Wed, 23 Nov 2016 22:24:36 -0800 (PST) Received: from calancha-pc (57.92.100.220.dy.bbexcite.jp. [220.100.92.57]) by smtp.gmail.com with ESMTPSA id z9sm57019004pfd.29.2016.11.23.22.24.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Nov 2016 22:24:36 -0800 (PST) From: Tino Calancha To: bug-gnu-emacs@gnu.org Subject: 26.0.50; epatch might parse wrongly a file name Date: Thu, 24 Nov 2016 15:24:31 +0900 Message-ID: <871sy1s8dc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) That's why sometimes while we are applying a multi-patch we see a message similar as: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ediff has inferred that /home/foo/emacs/ediff-mult.el /home/foo/emacs/ediff-mult.el @@ are two possible targets for this patch. However, these files do not exist. Please enter an alternative patch target ... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Note that it mentions 2 targets, but it shows the same file twice. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From 2cc7a050a062cd3ea6051a4775001c8d10bc0aa6 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Thu, 24 Nov 2016 15:11:51 +0900 Subject: [PATCH] ediff-context-diff-label-regexp: Detect the end of second file * lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp): Skip '\n' in file names (Bug#25010). * test/lisp/vc/ediff-ptch-tests.el: New file. (ibuffer-test-bug25010): Add test for Bug#25010. --- lisp/vc/ediff-ptch.el | 11 +++++----- test/lisp/vc/ediff-ptch-tests.el | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 test/lisp/vc/ediff-ptch-tests.el diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 6a07f80..6e8e947 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -120,11 +120,12 @@ ediff-patch-default-directory ;; This context diff does not recognize spaces inside files, but removing ' ' ;; from [^ \t] breaks normal patches for some reason (defcustom ediff-context-diff-label-regexp - (concat "\\(" ; context diff 2-liner - "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)" - "\\|" ; unified format diff 2-liner - "^--- +\\([^ \t]+\\).*\n\\+\\+\\+ +\\([^ \t]+\\)" - "\\)") + (let ((stuff "\\([^ \t\n]+\\)")) + (concat "\\(" ; context diff 2-liner + "^\\*\\*\\* +" stuff "[^*]+[\t ]*\n--- +" stuff + "\\|" ; unified format diff 2-liner + "^--- +" stuff ".*\n\\+\\+\\+ +" stuff + "\\)")) "Regexp matching filename 2-liners at the start of each context diff. You probably don't want to change that, unless you are using an obscure patch program." diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el new file mode 100644 index 0000000..e201dfe --- /dev/null +++ b/test/lisp/vc/ediff-ptch-tests.el @@ -0,0 +1,43 @@ +;;; ediff-ptch-tests.el --- Tests for ediff-ptch.el + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; Author: Tino Calancha + +;; This program is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see `http://www.gnu.org/licenses/'. + +;;; Code: + +(require 'ert) +(require 'ediff-ptch) + +(ert-deftest ibuffer-test-bug25010 () + "Test for http://debbugs.gnu.org/25010 ." + :expected-result :failed + (with-temp-buffer + (insert "diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el +index 6a07f80..6e8e947 100644 +--- a/lisp/vc/ediff-ptch.el ++++ b/lisp/vc/ediff-ptch.el +@@ -120,11 +120,12 @@ ediff-patch-default-directory +") + (goto-char (point-min)) + (let ((filename + (progn + (re-search-forward ediff-context-diff-label-regexp nil t) + (match-string 1)))) + (should-not (string-suffix-p "@@" filename))))) + +(provide 'ediff-ptch-tests) +;;; ediff-ptch-tests.el ends here -- 2.10.2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.3) of 2016-11-24 Repository revision: dfc5b0f65531ef71cbd2c0cc956c246ea4239612 ------------=_1481112842-7436-1--