GNU bug report logs - #37217
[PATCH] vc-default-ignore implementation is incorrect

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>; Keywords: patch fixed; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 27.1, send any further explanations to 37217 <at> debbugs.gnu.org and Wolfgang Scherer <Wolfgang.Scherer@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 37217 <at> debbugs.gnu.org:


Received: (at 37217) by debbugs.gnu.org; 15 Sep 2019 13:06:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 15 09:06:11 2019
Received: from localhost ([127.0.0.1]:47492 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i9UEF-0004Zr-2E
	for submit <at> debbugs.gnu.org; Sun, 15 Sep 2019 09:06:11 -0400
Received: from quimby.gnus.org ([80.91.231.51]:33198)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1i9UEC-0004Zh-0I
 for 37217 <at> debbugs.gnu.org; Sun, 15 Sep 2019 09:06:08 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1i9UE8-0000K5-My; Sun, 15 Sep 2019 15:06:07 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
Subject: Re: bug#37217: [PATCH] vc-default-ignore implementation is incorrect
References: <4b41d328-04ef-8fc3-9b89-6362e83c37a6@HIDDEN>
Date: Sun, 15 Sep 2019 15:06:04 +0200
In-Reply-To: <4b41d328-04ef-8fc3-9b89-6362e83c37a6@HIDDEN> (Wolfgang Scherer's
 message of "Thu, 29 Aug 2019 02:53:20 +0200")
Message-ID: <87sgoxwvyb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Wolfgang Scherer <Wolfgang.Scherer@HIDDEN> writes: > Only
 the basename of FILE is written to the ignore file. This is > wrong for all
 filenames relative to project root with one ore > more parent directories.
 > > The remove option is also implemented [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 37217
Cc: 37217 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Wolfgang Scherer <Wolfgang.Scherer@HIDDEN> writes:

> Only the basename of FILE is written to the ignore file. This is
> wrong for all filenames relative to project root with one ore
> more parent directories.
>
> The remove option is also implemented incorrectly.

[...]

> A unit test showed, that the removal regexp was faulty. New version of
> patch attached.

Thanks; I've only lightly tested this, but if I read the code correctly,
I think it makes sense, so I've now applied it to Emacs 27.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37217; Package emacs. Full text available.

Message received at 37217 <at> debbugs.gnu.org:


Received: (at 37217) by debbugs.gnu.org; 29 Aug 2019 15:44:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 29 11:44:35 2019
Received: from localhost ([127.0.0.1]:52824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i3MbC-00028J-UV
	for submit <at> debbugs.gnu.org; Thu, 29 Aug 2019 11:44:35 -0400
Received: from mout.gmx.net ([212.227.17.22]:41627)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1i3MbA-00027u-9W
 for 37217 <at> debbugs.gnu.org; Thu, 29 Aug 2019 11:44:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1567093466;
 bh=OBZsritmqdteW6XvKUOveiE3Vgd+Z9Qd8Fzf9PQ089g=;
 h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To;
 b=giQIsVvwEio/mQMPU9dUhi5Mfaq5kK27PNgzvlyrDvNUNZL1hhgTZ0tTNPCuoOL5K
 tnIuZ3xbZzW7yhk1N01c1satEu4HHju4Py2iIiFVIFGOOF2ZWUdx04TRJ9r4w9xUjU
 WXqi8gvNr6JwmtX8PnU6T3iXi2zh3EdfynVGrOXU=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from sheckley.simul.de ([91.11.52.253]) by mail.gmx.com (mrgmx102
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MCwbX-1hthhC3FSt-009dpJ for
 <37217 <at> debbugs.gnu.org>; Thu, 29 Aug 2019 17:44:25 +0200
Received: from [127.0.0.1] (sheckley.simul.de [127.0.0.1])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by sheckley.simul.de (Postfix) with ESMTPSA id 2C4C41940B9F
 for <37217 <at> debbugs.gnu.org>; Thu, 29 Aug 2019 17:44:24 +0200 (CEST)
Subject: Re: bug#37217: Acknowledgement ([PATCH] vc-default-ignore
 implementation is incorrect)
To: 37217 <at> debbugs.gnu.org
References: <4b41d328-04ef-8fc3-9b89-6362e83c37a6@HIDDEN>
 <handler.37217.B.15670400118803.ack <at> debbugs.gnu.org>
From: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
Openpgp: preference=signencrypt
Autocrypt: addr=Wolfgang.Scherer@HIDDEN; prefer-encrypt=mutual; keydata=
 xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd
 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp
 Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD
 /2zY6Ayhxi62TS84VjikXrrmjXykAAaAmMVEyKKYb9L5pGlqiZz9g/K9xw1EUoZTYuaufquD
 v4rAGR58K/3V4CYfJLEeshMWiaXHvMmlxMznlG16/um4MvmR8B3r+cx0nOPK1JBdD2qrkNnF
 Mw8FB+zouLFB4Gt2IUC5IlOmZ8OQA/4qdU53CItzWsCr9Nux4L0qUlRweSmCnV8xGQ2wP5XI
 MawIQxxREvSrsYDG8cNnYETMg4iQFfIktwAoxCJvuFAwIB6ZxHGF4FcEZm64CXc2u7CmFLqt
 rVhXhIfMz9oEYC+HhGczGamn9ofbGTFd2hJEtPcQgWNR4f7+aKknmi2+OM0fV29sZmdhbmcg
 U2NoZXJlciA8d3NAc3ctYW10LndzPsJhBBMRAgAhBQJYmz3YAhsjBQsJCAcCBhUICQoLAgQW
 AgMBAh4BAheAAAoJEIUCr3Gr112VZZoAoLTBSTp1qGuNhLdXY04iaWCMYmHCAJ4kHPtQ6nTw
 kEq9qCHgVgXDaY7wjs7ATQRG+OiIEAQAhi0wjcxvA4tychg2NQuwBIf9LX/46l+74+QbewCn
 a4a+mw/9s5KYqLGtYMuu3/KYq9yBd53OYc7LWTLMxsGOIATSOQRhdCKYW1AanupYrC/bKNW/
 8i2QEXc7LIeYiaII0TkVdQTVZxrg9kKLQ+Vf6z04Lbfv91sVCkHKI9jxgVMAAwUD/0mkDeN0
 tllPH+NOjbkkqlOj6UOwzwIYgXmALhuAEFGXVLM2HfRV9TtJa2OoGZiuhyGXat3Jl9QK9NNv
 d/J4HSal93ZHWstPU4YIRc5uhJ1eeWwKsfTmPvbZXMKMkh+hBBJ39SZnmxfoeUzkK0EQNE2p
 PZDyjAlz03qOx6D0DHnZwkkEGBECAAkFAkb46IgCGwwACgkQhQKvcavXXZU8PwCdGmUH5mbh
 dsLYyx7qthe4hOWnW54AoJQMfmHP4uUI6ji8VkdlvO8LKtLP
Message-ID: <96e5b707-0150-4deb-96eb-20e8cad14266@HIDDEN>
Date: Thu, 29 Aug 2019 17:44:23 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <handler.37217.B.15670400118803.ack <at> debbugs.gnu.org>
Content-Type: multipart/mixed; boundary="------------C10DB4A3B55AFBC7D5359829"
Content-Language: de-DE
X-Provags-ID: V03:K1:5UA9tnhVvlAgfRWxsbMQpr/MM1ZvEPnRhDYHuCQE3cYkePpdDX0
 nmF4n3A5hzj3EFKGENwTw3VKEoVGsalnmYiO/U7rGAj0iLnk+UHNOLVL+km9wApO766iCQU
 J5Zkz8NAiHlSFQHqRP88j5JbzakK5MYf8eAiUtY8/0P3xke0yUyetVmnZvfuZWJZ3i3K8YH
 gFdVSvLZkZV0Cw8xOAw4g==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:BY72etTToPg=:yNCciQrL2ueMJMqHjdKW+k
 fePtm2oYFYkndYv7byPDIGnJJnr6xTQTetUWQJOW0XmZrNOfxypuCm70QsW1iq9m6OCt6mk25
 ORUXU75i3RQ2Efpv9wnUbBkIngBHT8bkW1zmFpeIZhCykBWxH3FR7izuVkaYkH+hNnqdny8AS
 xyuOE99nsreyo5mAvHCbAQBcWRfIIdo7xOFgsPSlhr9viPeZb/CWVHI8HuyF7rOkxVgN+RwrA
 zdiTw54yhQXOqQNDPcmpT5WwIap1aTrFfVrDro92xupUVwcvNxKZbmScr+JGrN6yZ4fE8w1Gf
 xsZNzIwkVfMxPDVCofMMmoDSpdrzVXgVl0o8JjhrU3e8TvDVx0Kz3vNiASNnZXE2rh2CdrdKv
 6nr5MLWM+fFgK2ACj08JCIXHP6uKE7NG5Ifdko8NDEPks5Uwq5srtIaOKYuZhoEdUZkafkwsE
 CSzFXlQc1t9CWI0SL+wqmX1wfXFSAb+labmbdiTqsoOjUqa7X84WAMwz8+eFMInaMO4iAQdBZ
 VjPQSUZVFkThMVleoQhCwO2ZgJ4mxIZokIugsoCHTRBNBBat+yHx4QpDh2yc7ZHoEcV0hmIWl
 LXD6cdmP1CKRszmDszng4wFtxmyg1dtVrqPODdmN9QkxxYBklti9iSbLWsBhMxSBDz+HbUDfy
 wYrCZQOki78SXxayinVy5Y/Nnzb806CnCvDfnZHjqXIs0XemP9vQmNBxcmwBtH0/fGK/xZuae
 3LyDhvZKG3al0udoCONWFHDZZTKrS++sl4tUrLy9i7s5I4dyARXAqPwXaFLZI/HNtkrcqKiPq
 CNPOy19UWLeTTgPznkqc7G9KcyNcJtpIozP7Z/Ml0U+r92nECuOQ+V6i2fZ5yaD69Im8+/dI6
 r0VK9Xbt18LQpo1XS3iERlNHv5bVQLLcU5+TA8MG90T8DYEAkmBf87Ik7HxwUexv99hWGDDAv
 UaqnYQ4BQFxfLk8NMctKyKtbGbp9ExxdBbIiwoV2lg+9FScyIhUMrxvd78LZvS3C6XCzHNZZ0
 Sr7xZFJSjHCopMnmcqCui/nLqM732+r44bSeun2ylTl0NwY5h2iFGms3PxP9dXZJdSmzqKWUv
 ZVhge6F+HvLmzTqs/sybfXU1e6DEFIZ+ZGB3qyBDM96EFi4+E21uQ+8GswjOgck56qcoBlCa7
 ngcEEpalURIgdfGqwCidYggOzvTy0v/7LjNjgmytGNvJ0ZMA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 37217
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

This is a multi-part message in MIME format.
--------------C10DB4A3B55AFBC7D5359829
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

A unit test showed, that the removal regexp was faulty. New version of patch attached.


--------------C10DB4A3B55AFBC7D5359829
Content-Type: text/x-patch;
 name="0001-Fix-vc-default-ignore.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="0001-Fix-vc-default-ignore.patch"

=46rom d2638e621c8da1f93345a5d87691b165d5a05569 Mon Sep 17 00:00:00 2001
From: Wolfgang Scherer <wolfgang.scherer@HIDDEN>
Date: Thu, 29 Aug 2019 17:39:21 +0200
Subject: [PATCH] Fix vc-default-ignore

* lisp/vc/vc.el: (vc-default-ignore) Treat FILE parameter as relative
to DIRECTORY parameter.  Construct a file-path relative to directory
of ignore file.  When removing, use properly anchored regexp.  Remove
entire line, not just the match.
=2D--
 lisp/vc/vc.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 4cac153..c982b02 100644
=2D-- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1417,17 +1417,22 @@ remove from the list of ignored files."

 (defun vc-default-ignore (backend file &optional directory remove)
   "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'=
).
-FILE is a file wildcard, relative to the root directory of DIRECTORY.
+FILE is a wildcard specification, either relative to
+DIRECTORY or absolute.
 When called from Lisp code, if DIRECTORY is non-nil, the
 repository to use will be deduced by DIRECTORY; if REMOVE is
 non-nil, remove FILE from ignored files.
 Argument BACKEND is the backend you are using."
   (let ((ignore
 	 (vc-call-backend backend 'find-ignore-file (or directory default-direct=
ory)))
-	(pattern (file-relative-name
-		  (expand-file-name file) (file-name-directory file))))
+	file-path root-dir pattern)
+    (setq file-path (expand-file-name file directory))
+    (setq root-dir (file-name-directory ignore))
+    (when (not (string=3D (substring file-path 0 (length root-dir)) root-=
dir))
+      (error "Ignore spec %s is not below project root %s" file-path root=
-dir))
+    (setq pattern (substring file-path (length root-dir)))
     (if remove
-	(vc--remove-regexp pattern ignore)
+	(vc--remove-regexp (concat "^" (regexp-quote pattern ) "\\(\n\\|$\\)") i=
gnore)
       (vc--add-line pattern ignore))))

 (defun vc-default-ignore-completion-table (backend file)
=2D-
2.7.4


--------------C10DB4A3B55AFBC7D5359829--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#37217; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Aug 2019 00:53:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Aug 28 20:53:31 2019
Received: from localhost ([127.0.0.1]:51424 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1i38gt-0002Hs-5m
	for submit <at> debbugs.gnu.org; Wed, 28 Aug 2019 20:53:31 -0400
Received: from lists.gnu.org ([209.51.188.17]:41992)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1i38gr-0002Hl-EE
 for submit <at> debbugs.gnu.org; Wed, 28 Aug 2019 20:53:29 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40378)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1i38gq-0008R7-AD
 for bug-gnu-emacs@HIDDEN; Wed, 28 Aug 2019 20:53:29 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 RCVD_IN_DNSWL_LOW,URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Wolfgang.Scherer@HIDDEN>) id 1i38gp-0006kH-79
 for bug-gnu-emacs@HIDDEN; Wed, 28 Aug 2019 20:53:28 -0400
Received: from mout.gmx.net ([212.227.17.22]:50995)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <Wolfgang.Scherer@HIDDEN>)
 id 1i38go-0006k3-Sk
 for bug-gnu-emacs@HIDDEN; Wed, 28 Aug 2019 20:53:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1567040002;
 bh=aMeA05dneAoJKVwyEF80DAfci9RaDhKChLXctsYoFeo=;
 h=X-UI-Sender-Class:To:From:Subject:Date;
 b=ZQl8uVqrTFVPTVz+7ohFBikIpRVhfHziRQjKMfbd+DeoTl5mYDVwio8lzlca2jbb+
 XoyOcSIiUsXbfXXB2MGMsdShifGNMfLo02snRqZEENZs8SMuUbjkUwGbv0JDHZ0xVs
 1RjvyzpoUmWLG28oVvEAHoUbgT5cjfoJ7qzRnR/Q=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from sheckley.simul.de ([87.144.41.174]) by mail.gmx.com (mrgmx102
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LaaVn-1iTvbR1N9j-00mHz2 for
 <bug-gnu-emacs@HIDDEN>; Thu, 29 Aug 2019 02:53:22 +0200
Received: from [127.0.0.1] (sheckley.simul.de [127.0.0.1])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by sheckley.simul.de (Postfix) with ESMTPSA id CAABD1942B0A
 for <bug-gnu-emacs@HIDDEN>; Thu, 29 Aug 2019 02:53:20 +0200 (CEST)
To: Emacs Bugs <bug-gnu-emacs@HIDDEN>
From: Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>
Subject: [PATCH] vc-default-ignore implementation is incorrect
Openpgp: preference=signencrypt
Autocrypt: addr=Wolfgang.Scherer@HIDDEN; prefer-encrypt=mutual; keydata=
 xsDiBEb46IgRBACMHOAb1KNo1Ylk+ebri+4R+bG4tyKlqBlrpv8D9/ZwRdXSGt+0DyCHoaAd
 7KW7noHapLe87DunABOjKG4nqTGv+dRiWuUBlp3I4aYRFDVa3Da+XnIYkMHKqhK59VEHQCdp
 Km42nuLS7TS+n99at9YwzTG6VBdOlBKTlRFngOjVLwCg1RGXJ6X3EjS1FKCQeXziURVpWlkD
 /2zY6Ayhxi62TS84VjikXrrmjXykAAaAmMVEyKKYb9L5pGlqiZz9g/K9xw1EUoZTYuaufquD
 v4rAGR58K/3V4CYfJLEeshMWiaXHvMmlxMznlG16/um4MvmR8B3r+cx0nOPK1JBdD2qrkNnF
 Mw8FB+zouLFB4Gt2IUC5IlOmZ8OQA/4qdU53CItzWsCr9Nux4L0qUlRweSmCnV8xGQ2wP5XI
 MawIQxxREvSrsYDG8cNnYETMg4iQFfIktwAoxCJvuFAwIB6ZxHGF4FcEZm64CXc2u7CmFLqt
 rVhXhIfMz9oEYC+HhGczGamn9ofbGTFd2hJEtPcQgWNR4f7+aKknmi2+OM0fV29sZmdhbmcg
 U2NoZXJlciA8d3NAc3ctYW10LndzPsJhBBMRAgAhBQJYmz3YAhsjBQsJCAcCBhUICQoLAgQW
 AgMBAh4BAheAAAoJEIUCr3Gr112VZZoAoLTBSTp1qGuNhLdXY04iaWCMYmHCAJ4kHPtQ6nTw
 kEq9qCHgVgXDaY7wjs7ATQRG+OiIEAQAhi0wjcxvA4tychg2NQuwBIf9LX/46l+74+QbewCn
 a4a+mw/9s5KYqLGtYMuu3/KYq9yBd53OYc7LWTLMxsGOIATSOQRhdCKYW1AanupYrC/bKNW/
 8i2QEXc7LIeYiaII0TkVdQTVZxrg9kKLQ+Vf6z04Lbfv91sVCkHKI9jxgVMAAwUD/0mkDeN0
 tllPH+NOjbkkqlOj6UOwzwIYgXmALhuAEFGXVLM2HfRV9TtJa2OoGZiuhyGXat3Jl9QK9NNv
 d/J4HSal93ZHWstPU4YIRc5uhJ1eeWwKsfTmPvbZXMKMkh+hBBJ39SZnmxfoeUzkK0EQNE2p
 PZDyjAlz03qOx6D0DHnZwkkEGBECAAkFAkb46IgCGwwACgkQhQKvcavXXZU8PwCdGmUH5mbh
 dsLYyx7qthe4hOWnW54AoJQMfmHP4uUI6ji8VkdlvO8LKtLP
Message-ID: <4b41d328-04ef-8fc3-9b89-6362e83c37a6@HIDDEN>
Date: Thu, 29 Aug 2019 02:53:20 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101
 Thunderbird/60.8.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------04F003101082A9DDA0F0355C"
Content-Language: de-DE
X-Provags-ID: V03:K1:GmIALAq9f8mwaAy6DglCLzEHMqrASeWD1LpcLxWeTikwpSfGzCK
 PuhWFkQQTBcMvmVzcpJAlGOaVBQz4s/2TADv4cfdBrsAoHlx8YDvZsovxImCyYRmKj+qO3e
 3rXV99qxtRYo+smFmtHdyuLwlVKDThJulKKAprlRpPkkKjHXUqtPrUDxb/v0AE7ByoypnCZ
 3LBR3enWRdWokSbUm4pJA==
X-UI-Out-Filterresults: notjunk:1;V03:K0:eC2NCKojhk4=:CLBHhjEuEYDB6loi3xMV6v
 053a0XzAimVBAabQaCdajh4J/HPULNAZwBE40AKOJHvwF6bRvpPUILHWRMBz0+lUe0KyBvYUR
 v3BVBYtULiUTRfMIglrskfClcbWx4/588ijylgjpGf7SPU/DSAOLPhyqS+l6uc0hsPFFn7ZTN
 m7do3jP/QcV9WfEHWRZbsD/aFn20TaOrArw9KWc/c1S1039aufa/cvZBJxgrPiYZm7ihfcBjs
 bmtP1kNY0qS1beOW/SHU42trgY6s+uR/x7UjDfYQyl0Sd/Hd7ASzTqrqy4SIJNoYPg0joQI8F
 Y6L4c3QYhu2OiXy4C2LvWhP/60bQonrA9CM488owWfPP4hoALV2e2RfzaHBktCUelriAW4r1e
 q92QUz+GpF09dfsUMrTB/HcPVTSVGFoD23NF6B1x6MqEWgntEQgxn4Jd789yFHhIcKmAA0iUL
 N0sHGZzFZlH9RPWEDXash+F74XZUcq/nm7830P1of6UITFW30OIJVDj7ee8D4y+lndJnrzo++
 zcU6oOvV52W2t9KjlQjWg9Idwq5eI7KWQfe9d9zS068sVADM8xxjwoPYi0XryMLglY35QwV83
 ZvJ5RG1lap9q1bbfCQqH3NDIn841Jwi3x8IX+ZtUjEmW4WxsgnbcZFtJxZI3G1rcRhkskiW6W
 kpYADURakdljaU1SPf/4Az4TtZ+66WBVVh0CtTVzcmn6gsbNA8X0jkH2YHmK8nwv694pKTkqG
 VbrIRCNnJDYLvBl9vdogrH/HJl+iJ1AvKfRJYxTx6LRve0kF1HoAstVIfAQ90DkHsYL2r02ha
 AaOD5wAzsvCeY8VdapL7n9C4MWvsWR5fqGMxFPldpP7ziNpklh1sXFa2ilXtAU2z00U06uTQd
 e7CIqIRAdq4QsSq344xaB0jgiOf42zEi3LIm8qrNU1QT4WOjlVz/mk7pf7u6fyMulq+lAefSn
 x/G2sexNp3WuUkGgISb9oL8uwMWzlwK+GL+lQovAwGcVh8sd+sdbC9gM9zr0ZgLfeejIjM2ht
 JZMIEstsWoEx9rtbx9p4fwLO2hde8yL5SWIy3IO1W7hpL0SQR8qgVnUmAL742Memeo6gyMpmv
 N4sgVj1d58hppWd+w/9G/sx1MCukHdDMzdn2We6fZ1g/l4efqHKVyrkYQ==
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.17.22
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

This is a multi-part message in MIME format.
--------------04F003101082A9DDA0F0355C
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Only the basename of FILE is written to the ignore file. This is
wrong for all filenames relative to project root with one ore
more parent directories.

The remove option is also implemented incorrectly.

The attached patch fixes these errors.


--------------04F003101082A9DDA0F0355C
Content-Type: text/x-patch;
 name="0001-Fixes-vc-default-ignore.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="0001-Fixes-vc-default-ignore.patch"

=46rom 7ca81822189035db9a117b66ed8365b4eb2ab88b Mon Sep 17 00:00:00 2001
From: Wolfgang Scherer <wolfgang.scherer@HIDDEN>
Date: Thu, 29 Aug 2019 02:51:03 +0200
Subject: [PATCH] Fixes vc-default-ignore

* lisp/vc/vc.el: (vc-default-ignore) Treat FILE parameter as relative
to DIRECTORY parameter.  Construct a file-path relative to directory
of ignore file.  When removing, use properly anchored regexp.  Remove
entire line, not just the match.
=2D--
 lisp/vc/vc.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 4cac153..2b1f163 100644
=2D-- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -1417,17 +1417,22 @@ remove from the list of ignored files."

 (defun vc-default-ignore (backend file &optional directory remove)
   "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'=
).
-FILE is a file wildcard, relative to the root directory of DIRECTORY.
+FILE is a wildcard specification, either relative to
+DIRECTORY or absolute.
 When called from Lisp code, if DIRECTORY is non-nil, the
 repository to use will be deduced by DIRECTORY; if REMOVE is
 non-nil, remove FILE from ignored files.
 Argument BACKEND is the backend you are using."
   (let ((ignore
 	 (vc-call-backend backend 'find-ignore-file (or directory default-direct=
ory)))
-	(pattern (file-relative-name
-		  (expand-file-name file) (file-name-directory file))))
+	file-path root-dir pattern)
+    (setq file-path (expand-file-name file directory))
+    (setq root-dir (file-name-directory ignore))
+    (when (not (string=3D (substring file-path 0 (length root-dir)) root-=
dir))
+      (error "Ignore spec %s is not below project root %s" file-path root=
-dir))
+    (setq pattern (substring file-path (length root-dir)))
     (if remove
-	(vc--remove-regexp pattern ignore)
+	(vc--remove-regexp (concat "^" (regexp-quote pattern ) "\n?") ignore)
       (vc--add-line pattern ignore))))

 (defun vc-default-ignore-completion-table (backend file)
=2D-
2.7.4


--------------04F003101082A9DDA0F0355C--




Acknowledgement sent to Wolfgang Scherer <Wolfgang.Scherer@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#37217; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 15 Sep 2019 13:15:01 UTC

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