From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Wolfgang Scherer Newsgroups: gmane.emacs.bugs Subject: bug#37189: 25.4.1: vc-hg-ignore implementation is missing Date: Sun, 9 Feb 2020 14:57:12 +0100 Message-ID: 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> <95da41e8-7a55-a15c-cfa7-d70366f9ee6b@gmx.de> <412195c1-e196-12af-933b-0312f5075847@yandex.ru> <57825d73-27a4-d5f5-8198-a172796a558a@gmx.de> <1ebc6077-9175-65ba-4996-282bb2c8eca5@yandex.ru> <6145d6f6-37a8-7166-731b-57669086b145@gmx.de> <838slmk90j.fsf@gnu.org> <83h806gp2w.fsf@gnu.org> <8336bmg1o9.fsf@gnu.org> <2354821b-5c1e-f9e3-3a64-4ff978ded33b@gmx.de> <83sgjkdev5.fsf@gnu.org> <3fb73dbc-bf31-233b-4afc-2147c4ffd5b7@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="94796"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 Cc: 37189@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 09 14:58:35 2020 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 1j0n6Y-000OYV-In for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Feb 2020 14:58:34 +0100 Original-Received: from localhost ([::1]:50568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0n6X-0000EZ-Dq for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Feb 2020 08:58:33 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59402) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0n63-0000E9-Nu for bug-gnu-emacs@gnu.org; Sun, 09 Feb 2020 08:58:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0n62-0001Wh-CC for bug-gnu-emacs@gnu.org; Sun, 09 Feb 2020 08:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0n62-0001WE-8o for bug-gnu-emacs@gnu.org; Sun, 09 Feb 2020 08:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j0n62-0003I4-7E for bug-gnu-emacs@gnu.org; Sun, 09 Feb 2020 08:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wolfgang Scherer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Feb 2020 13:58:02 +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.158125664412584 (code B ref 37189); Sun, 09 Feb 2020 13:58:02 +0000 Original-Received: (at 37189) by debbugs.gnu.org; 9 Feb 2020 13:57:24 +0000 Original-Received: from localhost ([127.0.0.1]:52198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0n5Q-0003Gt-6l for submit@debbugs.gnu.org; Sun, 09 Feb 2020 08:57:24 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:59333) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0n5N-0003GQ-7c for 37189@debbugs.gnu.org; Sun, 09 Feb 2020 08:57:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1581256635; bh=IoPR5l19VCoDcEEBsHG5g4aONi+ORYr+RaWsDdeSmk4=; h=X-UI-Sender-Class:Subject:From:To:Cc:References:Date:In-Reply-To; b=JSZXlbIV2bFD9PdKD8WbBSdk1UAWJwq6/lcDvgSC9TZuCWTRdkTMIBE1GlFE5wLCW 2Xt5WI0hVMD1DQ61kH/WSYCxNWj/PiNoGNYpkpKRyxqNUyONs/q7gVVpraIDn67N21 wy91tfhfXeI+7YzyPnn/AHD1i0IgsgUoxgsM3Y38= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M2wKq-1j44s23SRg-003JMy; Sun, 09 Feb 2020 14:57:14 +0100 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 8986B19431D1; Sun, 9 Feb 2020 14:57:13 +0100 (CET) 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: <3fb73dbc-bf31-233b-4afc-2147c4ffd5b7@gmx.de> Content-Language: de-DE X-Provags-ID: V03:K1:7fKVmjJF8FxEvUe7AxY+ccLAt+od1897lsyDdbzYRrF7N4DNEni T4VEuWfYR7aRHEpe0F03YtqGRBUXjjd6VA9BgAWHwRVHh3fehh3c/KJ6wUieUTCgaHAJOGF NNRMdft8O2khHacD2303IWQBangeP918yOboqCWVXf2i4W9q5cKJneu1v80CGUpruOnHJ9z wh4cepsK7YvBPPD1gfD1Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:iFcrubHJ9So=:0duaevhw2QgU7nFy4EkzYZ xNSinKyof1Qz98I76m3MUT5UslIDr2nI5ty+MTTdegRBldypUP9yHZIY/ZIbHL71bxcpt9Pwd SlgdB/AmRlypcRy22fvUPLc9SMRFEqg6pvwSlXo/Y+CektBHdZYwS6o92Jh4zt6O+N5Oo2YIO fJDJkaL6Ki0Ef16ScEacvlL7BiupK1zqXOxpMERajbLWZztYOhqsHsvOkeiOhua/FYHgzXom7 MceTEtWiMe+ShTwupiuDvi6K2bKJRsgOPWTDZzlOlOc8bE9UO0vpkLSeH7V7ivDjcmhJljtGC 69+TCR/eiIw980h/YQ98FKLQiJ+EHF8CLXA8qvKnmiSJZA/ufdQ3FQv53HEdr40EpE+cw3XoI I8bShFv87PuvK0Z0+zON8VPVVjxBwOYL67BS0L9WZt7zKmVHIEJnNaBLaVFOFP6NwJrKGq/X8 evKl3eIA0I+Es9F/ORYK7Kchb7G8lQ2db9GXMnBQenRU3kjt7gMM5l5X1GBkgQXArDCzpxOSE GH0JhwHwZ/YLaXC15RiPNGDeu/aSIJPbaygpio3FBYlC6DHaLsaEfyQfotaLsI2VPIYRu7m9M +8Uew4fBnjPjq3ejTdZ9UXouTxHcWlfES9lcoM1fRq11coB4sVlznNEx2IVb5efG6b/3FQbts pVUSW6/J7ARU+0aOhxY3eaYLk8t1lwCySkgO6ikStLmREShBX60zQqnTbX08U6FClFOonWs20 82rorcXm4E1BQ5z2iaWUaJuCRSW8tER2T+oCY7UhKp1DMX72WoOCYq8Z8mjkiwwxAo5jHktf 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175823 Archived-At: Let me clarify this one last time. > The "pattern" use case is not the "wildcard" use case. "pattern" is an u= nspecified string, while "wildcard" is backend specific. For SVN it is a g= lob(7) expression without subdirectories (otherwise it does not match anyt= hing). > "pattern" is a generic term, which does not imply a specific syntax. "wildcard specification" is a pattern following the rules of a glob(7) syntax variant. "regexp pattern" implies one of the regular expression syntaxes (regex(7), Emacs, Perl, Python, ...). Citing from 4.2.1. file pathes are not patterns (http://sw-amt.ws/emacs/do= c/_build/html/emacs-vc-ignore-feature.html#file-pathes-are-not-patterns): =C2=A0=C2=A0=C2=A0 Assuming that a file path is always a pattern that matc= hes the =C2=A0=C2=A0=C2=A0 file path unambiguously is simply wrong. =C2=A0=C2=A0=C2=A0 When ignoring a specific file path and nothing but that= file =C2=A0=C2=A0=C2=A0 path, a pattern must be constructed that matches the fi= le path =C2=A0=C2=A0=C2=A0 exactly. The syntax for this pattern is backend specifi= c and the =C2=A0=C2=A0=C2=A0 pattern is generally not the file path itself. In other= words: it =C2=A0=C2=A0=C2=A0 is an exception that a file path and the exactly matchi= ng pattern =C2=A0=C2=A0=C2=A0 are identical strings. Specifically, if a file path con= tains a =C2=A0=C2=A0=C2=A0 character with special meaning in the pattern syntax, t= hen the =C2=A0=C2=A0=C2=A0 matching pattern cannot be identical to the file path s= ince the =C2=A0=C2=A0=C2=A0 special character must be escaped. =C2=A0=C2=A0=C2=A0 +-------------+-----------------+---------------+------= -----------+--------------------+ =C2=A0=C2=A0=C2=A0 | `file path` | glob(7)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | anchored glob | Hg `regex`=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | Bzr `regex`=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | =C2=A0=C2=A0=C2=A0 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ =C2=A0=C2=A0=C2=A0 | test[56].xx |=C2=A0=C2=A0 test\[56].xx=C2=A0 | /test\= [56].xx | ^test\[56]\.xx$ | RE:^test\[56]\.xx$ | =C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 test[[]56].xx |=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | =C2=A0=C2=A0=C2=A0 +-------------+-----------------+---------------+------= -----------+--------------------+ =C2=A0=C2=A0=C2=A0 | simple.txt=C2=A0 |=C2=A0=C2=A0 simple.txt=C2=A0=C2=A0= =C2=A0 | /simple.txt=C2=A0=C2=A0 | ^simple\.txt$=C2=A0=C2=A0 | RE:^simple\= .txt$=C2=A0=C2=A0 | =C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0 simple[.]txt=C2=A0 |=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | =C2=A0=C2=A0=C2=A0 +-------------+-----------------+---------------+------= -----------+--------------------+ =C2=A0=C2=A0=C2=A0 The correct escaping of FILE can only be determined by = the =C2=A0=C2=A0=C2=A0 backend. Therefore neither vc-dir-ignore nor lisp code = calling =C2=A0=C2=A0=C2=A0 vc-ignore can escape the FILE parameter correctly witho= ut support =C2=A0=C2=A0=C2=A0 from the backend. This makes pattern input for FILE onl= y useful =C2=A0=C2=A0=C2=A0 during interactive calls. Even, if it was magically possible to determine the correct pattern in the frontend, submitting an anchored glob "/some-sub/file.txt" to `vc-ignore` would be interpreted as an absolute path. In other words, the API specificaton =C2=A0 [...] FILE is a wildcard specification, either relative to =C2=A0 DIRECTORY or absolute. which asks for implementing the pattern use case inextricably mixed with the file path use case, is nonsense. It also means, that all of the backend functions which currently demand a pattern are absolutely useless. Therefore the API change request is specifically: =C2=A0=C2=A0=C2=A0 (defun vc-ignore (file-or-pattern &optional directory r= emove as-is) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Ignore FILE-OR-PATTERN under VCS of DIRECT= ORY. =C2=A0=C2=A0=C2=A0 DIRECTORY defaults to `default-directory' and is used t= o =C2=A0=C2=A0=C2=A0 determine the responsible VC backend. =C2=A0=C2=A0=C2=A0 When REMOVE is non-nil, remove FILE-OR-PATTERN from the= list of =C2=A0=C2=A0=C2=A0 ignored files. =C2=A0=C2=A0=C2=A0 If AS-IS is nil, FILE-OR-PATTERN is considered a file p= ath that =C2=A0=C2=A0=C2=A0 must be escaped and anchored. The directory name of =C2=A0=C2=A0=C2=A0 FILE-OR-PATTERN expanded against DIRECTORY is used to d= etermine =C2=A0=C2=A0=C2=A0 the ignore file.=C2=A0 The effective pattern consists o= f the file path =C2=A0=C2=A0=C2=A0 relative to the directory of the ignore file, properly = escaped =C2=A0=C2=A0=C2=A0 and anchored by the VC backend. =C2=A0=C2=A0=C2=A0 If AS-IS is non-nil, FILE-OR-PATTERN is considered a pa= ttern that =C2=A0=C2=A0=C2=A0 should not be modified.=C2=A0 DIRECTORY is used to dete= rmine the =C2=A0=C2=A0=C2=A0 ignore file."