From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Wolfgang Scherer Newsgroups: gmane.emacs.bugs Subject: bug#37189: 25.4.1: vc-hg-ignore implementation is missing Date: Thu, 29 Aug 2019 03:23:09 +0200 Message-ID: <338bfe07-2d7b-1014-dfcd-e358e6844833@gmx.de> References: <1ba53ae2-42a4-3ab3-d4f2-2ceae565d198@gmx.de> <52917e6f-2f00-25cf-4353-dfb40287d0ea@gmx.de> <83pnkrdpb3.fsf@gnu.org> <679942e8-abe9-b0fc-720d-75a54d8d0b5a@gmx.de> <83sgplddbv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="24103"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: 37189@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 29 03:24:38 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i39Az-00067K-L6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Aug 2019 03:24:37 +0200 Original-Received: from localhost ([::1]:44286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i39Ax-0004RR-7P for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Aug 2019 21:24:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46904) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i39AR-0004Oe-CF for bug-gnu-emacs@gnu.org; Wed, 28 Aug 2019 21:24:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i39AQ-0003F3-73 for bug-gnu-emacs@gnu.org; Wed, 28 Aug 2019 21:24:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i39AQ-0003Ez-49 for bug-gnu-emacs@gnu.org; Wed, 28 Aug 2019 21:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i39AP-00037i-RZ for bug-gnu-emacs@gnu.org; Wed, 28 Aug 2019 21:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wolfgang Scherer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Aug 2019 01:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37189 X-GNU-PR-Package: emacs Original-Received: via spool by 37189-submit@debbugs.gnu.org id=B37189.156704180311952 (code B ref 37189); Thu, 29 Aug 2019 01:24:01 +0000 Original-Received: (at 37189) by debbugs.gnu.org; 29 Aug 2019 01:23:23 +0000 Original-Received: from localhost ([127.0.0.1]:51430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i399m-00036i-Pm for submit@debbugs.gnu.org; Wed, 28 Aug 2019 21:23:23 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:35643) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i399k-00036S-Af for 37189@debbugs.gnu.org; Wed, 28 Aug 2019 21:23:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567041791; bh=afhy3k9Xo1iqmjhtk/BfWgsdDEYxy7JUhBwpdS1IQ3Y=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=MnJsAwCfP+p2OmhtV0WmRk/2tqRVR+pRdDQoE0cU5/R1hJnXeL9dHYRJ8VcasQj9M GG6udVqR12fMf1ezZo4GVEaS3JpVpWShYEKpIv+FuY7m2T1diOvXATu/mG2DqqGp+L dUR3fgI5AUGwfuClvOovYECp9gy+FV2pZpcYDWx0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from sheckley.simul.de ([87.144.41.174]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mnpnm-1iZhw51XDO-00pIIf; Thu, 29 Aug 2019 03:23:11 +0200 Original-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 9E1BA1942B0D; Thu, 29 Aug 2019 03:23:09 +0200 (CEST) Openpgp: preference=signencrypt Autocrypt: addr=Wolfgang.Scherer@gmx.de; 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/9s5KY In-Reply-To: <83sgplddbv.fsf@gnu.org> Content-Language: de-DE X-Provags-ID: V03:K1:42LdGEqnu5SHMic7bPEiIqj0Cq+wtTE1C2E7koduKUkg/I2D6Pc yBO4AjauCexGNFlqQTGqQ/3B5JS0GxrnkpT4vTGW5S/YkIOKiEHkM524OyTbRI4Zkh7Mq1C sZLK0Rz4xdujmM0klOWklYYBxDCG2/LEivdMsDHmpySqL6QXIcVfNc/Bd0mJyOYcob9Qh0i zSSZsLs7WsolCMEalc/3w== X-UI-Out-Filterresults: notjunk:1;V03:K0:do8YAS0BK7w=:UpekiNZm/IChV78lVDYujj hwG6eYWiS4GxMmQN/CeoEmopMec+HWxSVTs/18M5njkbecm1xiKX7nuxHL1hK9opzua0VgH6c QY/byIGh+N/dY5G3Ay/7oTM1//SSJRa0hb18lbmEb6yXlAFgjpyDnmKDk25FIGUlqRRKxEp+J nfa40WSVxazuTyEyzKv+wClvMSSXRArZa6+bKk7p7pAaMn2wv2euKJFW4/1CNm8JsCDX5XvVk Dqf4Nh1dedPCZZIFR12teLJt/YPOmYCK7kBwEs2tvNqizMTxa012RFWxQRVaiJ4MfPJfEEKBg k6jPi0h/GedIayQpxCQAu17R/4W8nUGjaiT6tZI3ylr+mxWExjIKX3d4F2ueieJoqnKFZLMzm PLlPgs/lfDQ0dIb8xZ+GGrYFY13A9V9VP9aNIOvRxFSj1JHJdD1e9JhSYl0ZQr4d5CwJJXPdS Xt0nG2yEiLr/UDInInAM8o/c0+t5w2ZJRpEc+8B6o4UwTske8EH12fd6PZIZ0A5vIyRJaEhzM nXgAmj+0aLOaL4I24nwVLMzrGaAdgvTX5DmoaIuqbkXMgtlTFYzghVLm+Jy5AvXxY2yDiGmPf PA3Ld8dT794wNarq5zdEXfke8aYHklhhX6ZIHRkTxl3Da270XBzNaSm0LHIa/6X7D3WBzqqKa Nh5bx3+s3NJeMdSaXgN2U4iQrRkfgQnyf6vcHYgXhmMyT8gGM/qRFbH0qADl8L8+KA2IuzbQp ksA9cu87EMsslSo2Dn8azXQRZglpQKNTRIVyGkHCvk9L80Ibgc946Sv4UPHzyr83NjmH/dT2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166033 Archived-At: Am 28.08.19 um 08:16 schrieb Eli Zaretskii: >> Cc: 37189@debbugs.gnu.org >> From: Wolfgang Scherer >> Date: Wed, 28 Aug 2019 03:46:53 +0200 >> >>>> +(defun vc-hg-ignore (file &optional directory remove) >>>> + "Ignore FILE of DIRECTORY (default is `default-directory'). >>>> + >>>> +FILE is a file wildcard, relative to the root directory of DIRECTOR= Y. >>> I think instead of "root directory of DIRECTORY" this should say "the= >>> top-level directory of DIRECTORY's repository". >> I disagree. This comment is a modified version of the comment for >> `vc-default-ignore'. And the exact same phrase also pops up for >> `vc-svn-ignore': > But do you agree that the alternative text I proposed is more accurate > and more clear? If so, we might wish to change all those places to > use the better wording. It could be a separate commit, of course. I agree, that the text should be corrected (and I already did so for `vc-hg-ignore').=C2=A0 I do not agree to introducing the term `top-level directory' as replacement for `project root'. However, the problem here is not the wording, but the incorrect/incomplete implementation of various commands/functions. (Actually, not a single handler implementation is correct. Not even CVS.) 1. `vc-ignore' provides the API specification for the =C2=A0=C2=A0 backend-specific implementations: =C2=A0=C2=A0=C2=A0=C2=A0 "Ignore FILE under the VCS of DIRECTORY. =C2=A0=C2=A0=C2=A0=C2=A0 Normally, FILE is a wildcard specification that = matches the files =C2=A0=C2=A0=C2=A0=C2=A0 to be ignored.=C2=A0 When REMOVE is non-nil, rem= ove FILE from the list =C2=A0=C2=A0=C2=A0=C2=A0 of ignored files." =C2=A0=C2=A0 =C2=A0=C2=A0 Based on this API, mentioning the project root at all does n= ot =C2=A0=C2=A0 make any sense. =C2=A0=C2=A0 If the wildcard specification is relative, it is relative to= =C2=A0=C2=A0 DIRECTORY (or default-directory).=C2=A0 It is definitely not= =C2=A0=C2=A0 relative to the project root. =C2=A0=C2=A0 2. `vc-cvs-ignore' implements only the appending part, but does =C2=A0=C2=A0 not implement the `remove' option. =C2=A0=C2=A0 When appending, the correct .cvsignore file is identified, =C2=A0=C2=A0 but when called with an absolute filename (which is the =C2=A0=C2=A0 default case), it writes the entire path into the .cvsignore= =C2=A0=C2=A0 file. =C2=A0=C2=A0 `vc-cvs-ignore' also writes duplicate strings into .cvsignor= e. =C2=A0=C2=A0 I submitted a patch for these errors as bug#37215. =C2=A0=C2=A0 (And yes, I still have a bunch of old unconverted CVS reposi= tories ;-)). 3. When `vc-svn-ignore' starts a new `svn:ignore' property, The =C2=A0=C2=A0 function `vc-svn-ignore-completion-table' parses an error =C2=A0=C2=A0 message as ignore patterns. The split also matches any =C2=A0=C2=A0 whitespace instead of lines only. I have submitted a patch f= or =C2=A0=C2=A0 these errors as bug##37214. =C2=A0=C2=A0 `vc-svn-ignore' states: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Ignore FILE under Subversion. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE is a file wildcard, relative to the r= oot directory of DIRECTORY." =C2=A0=C2=A0=C2=A0 This is just not true. The correct description is: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Ignore FILE under Subversion. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FILE is a wildcard specification, either r= elative to =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DIRECTORY or absolute." =C2=A0=C2=A0=C2=A0 `vc-svn-ignore' gets the relative filename right (in a= manner =C2=A0=C2=A0=C2=A0 suitable for Git), but then fails to add the ignore sp= ec to =C2=A0=C2=A0=C2=A0 the correct subdirectory, if the relative path has at = least =C2=A0=C2=A0=C2=A0 one level of directories. A patch is supplied as bug#3= 7216. 4. This leaves `vc-default-ignore'. =C2=A0=C2=A0 Both the description and implementation are wrong. =C2=A0=C2=A0 Only the basename of FILE is written to the ignore file. Thi= s is =C2=A0=C2=A0 wrong for all filenames relative to project root with one or= =C2=A0=C2=A0 more parent directories. =C2=A0=C2=A0 The remove option is also implemented incorrectly. =C2=A0=C2=A0 A patch is supplied as bug#37217. The mentioned commits replace all occurences of the incorrect description= =2E