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 00:12:40 +0100 Message-ID: <3fb73dbc-bf31-233b-4afc-2147c4ffd5b7@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> <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> 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="75327"; 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 00:13:34 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 1j0ZI5-000JUY-SE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Feb 2020 00:13:34 +0100 Original-Received: from localhost ([::1]:46138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0ZI4-0003XN-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Feb 2020 18:13:32 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35798) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0ZHb-0003Qp-Qr for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 18:13:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0ZHa-0004bL-7m for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 18:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45959) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0ZHa-0004aj-41 for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 18:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j0ZHZ-0003Un-Vm for bug-gnu-emacs@gnu.org; Sat, 08 Feb 2020 18:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wolfgang Scherer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Feb 2020 23:13: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.158120357113419 (code B ref 37189); Sat, 08 Feb 2020 23:13:01 +0000 Original-Received: (at 37189) by debbugs.gnu.org; 8 Feb 2020 23:12:51 +0000 Original-Received: from localhost ([127.0.0.1]:51932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0ZHO-0003UM-V2 for submit@debbugs.gnu.org; Sat, 08 Feb 2020 18:12:51 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:52785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0ZHM-0003U6-Ti for 37189@debbugs.gnu.org; Sat, 08 Feb 2020 18:12:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1581203562; bh=5DgMhnXDo+L35sCCNeXWaX7OqVuZ0G8Z+RImEeT6IGw=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=KzwhTw2puMgD7dFp1PTcjnAAUtY2R1yVyM3KS72s7svwHGIgtw31mclWqb82JVVJj TkIfscGFOWCUDJVj5yHEpyDQ1TouB3/15Rq6V+Acu8swKKYLA+q6+k5E4aRtIrTGM0 XSBHS8vqFySbFC1c1QqFuYFIoZLbhHJ1qvja3prA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MgvvJ-1jRxbz1SHN-00hKdu; Sun, 09 Feb 2020 00:12:42 +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 4823C19431CE; Sun, 9 Feb 2020 00:12:40 +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: <83sgjkdev5.fsf@gnu.org> Content-Language: de-DE X-Provags-ID: V03:K1:W1BWrKZ8ItPbOEBeMFBpJB8/aX1lDSl0YacWFQse7RWRTamg2a/ BZ4+xye8H3COIr8hbFM+Slg3ezYIt/MMw4eq20gqbK7qXQgXWFBXcyUemLn9JmopLF9EjGe o6Th+SfldaEjClZw464pfcf/BY2nm2rhW1afDlUZxPHBJc5vMwEsL46TBC9fzltYt/doNkx T9PeIIbwKJ6YZs7R8a0+g== X-UI-Out-Filterresults: notjunk:1;V03:K0:4GycJeuQhJ0=:zFM/Pr90GifIAj1NjJQC6b y6M9a/3X/H7DY0bzs7zS5RRotkhaDiwBiWZOIRRZ3eq1s7lgIc+0KWJzxbO7oCGCMJ3agzCpM dwjegBW0JpTC4A2H+pYhM783wd4C1CQDvmpv2aafWrcdG7XEAjGsVb9buIdkRWQwToefuQf7M 5qIVTiLvZtoAsFAMmBkHa2TbdT/lbsdLOt1MU0LTbj7rEXzhvhDbJqZmGbxuN5iViz+d/y0RC cCauHq9q6LRtNx2Sk4kBSF4itgy4JgI5wbTLk0AR3xM+maIH6VHBWq56iOJu9FcTl7d9LIYCa dWLYFfi0ngeKRMirtZbkTptcHFbIlLNwkNM5d8jYpZJMKMZT1WIQeyoM/Ji4ZJo33zqa6iZUw 51s0yU6S+fNYVfMN5EeDcfvyRR/4NE22TIL2VdIJ8vQwQZvB9YEobUObi68Otzq+UYVYP5lBk lkWdOD8SfvgUF4SfuzyWaKgOuN3O2OMrs3TtmkgR0x9tVu4q4QUCgAwLKnKeaKkT9qxQ4uljB V114cun8+464shlWM2v9UaXUsF54xHa9feZ+fB0akzXkYYpM+hQsbOr+xo0Jyahl8jf9kJjJt OGGAgs0lzGPq2ylzp9HfqLyiU0u9TFHSxvL74PZxG/yCMogw21PlmHlGSbeN8nrInAAevO70p VzRPFLf73FakNpzUm3wts0Dv+zwxlcwjgJCbYEkcQw0hiJM+pctjGu4L+N9wZQpvxUuLA7m+q RT5V4PnIaGdJN8MHrWVXZFuw2PqbJm/NJPrXWEF8OTarQ/59KJMHJ725Z2fyqV8yWgW80/1p 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:175810 Archived-At: Am 08.02.20 um 21:05 schrieb Eli Zaretskii: >> Cc: 37189@debbugs.gnu.org >> From: Wolfgang Scherer >> Date: Sat, 8 Feb 2020 20:45:34 +0100 >> >> The status quo before Emacs 27 is: >> >> 1. The argument FILE of `vc-ignore` is documented to accept a wildcard = specification. This is the use case "pattern". >> >> 2. `vc-ignore` is called from `vc-dir-ignore` with either an absolute o= r relative filename. This is the use case "file path". >> >> 3. Some backends expect a file path, some backends expect a pattern. Th= is cannot be fixed without adding a parameter to `vc-ignore`, `vc--ignore`. >> >> +-----------------------+-------------+-----------+ >> | function=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 | file path=C2=A0=C2=A0 | pattern=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+ >> | :func:`vc-ignore`=C2=A0=C2=A0=C2=A0=C2=A0 | strong hint | yes=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >> +-----------------------+-------------+-----------+ >> | :func:`vc-dir-ignore` | mandatory=C2=A0=C2=A0 | no=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 | >> +-----------------------+-------------+-----------+ >> | :func:`vc-cvs-ignore` | no=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | mandatory | >> +-----------------------+-------------+-----------+ >> | :func:`vc-svn-ignore` | mandatory=C2=A0=C2=A0 | no=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 | >> +-----------------------+-------------+-----------+ >> | :func:`vc-src-ignore` | --=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 | >> +-----------------------+-------------+-----------+ >> | :func:`vc-bzr-ignore` | no=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | mandatory | >> +-----------------------+-------------+-----------+ >> | :func:`vc-git-ignore` | no=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 | mandatory | >> +-----------------------+-------------+-----------+ >> | :func:`vc-hg-ignore`=C2=A0 | no=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 | mandatory | >> +-----------------------+-------------+-----------+ >> | :func:`vc-mtn-ignore` | --=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 | >> +-----------------------+-------------+-----------+ > This shows that (ignoring mtn for now) all of the functions support > the "pattern" case, except vc-svn-ignore. However, the doc string of > vc-svn-ignore says > > "Ignore FILE under Subversion. > FILE is a wildcard specification, either relative to > DIRECTORY or absolute." > > So it looks like it, too, supports the "pattern" use case, or what am > I missing? Well, FILE is used to construct a path, which is then split into file and = directory parts =C2=A0 (let* ((path (directory-file-name (expand-file-name file directory)= )) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (directory (file-name-dir= ectory path)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (file (file-name-nondirec= tory path)) The "pattern" use case is not the "wildcard" use case. "pattern" is an uns= pecified string, while "wildcard" is backend specific. For SVN it is a glo= b(7) expression without subdirectories (otherwise it does not match anythi= ng). Besides the point, that it may not serve a true purpose, It is not possibl= e to add a pattern containing a slash "/" to a SVN directory with `vc-svn-= ignore`). While the command: =C2=A0=C2=A0 >>> svn propset svn:ignore 'not-here/123' '/srv/install/linux= /emacs/check-svn'=C2=A0 works perfectly well and stores the property as given: =C2=A0=C2=A0 >>> svn propget svn:ignore '/srv/install/linux/emacs/check-sv= n' =C2=A0=C2=A0 not-here/123 The `vc` equivalent fails: =C2=A0=C2=A0 >>> (vc-svn-ignore 'not-here/123' '/srv/install/linux/emacs/c= heck-svn/') =C2=A0=C2=A0 'not-here' is not under version control =C2=A0=C2=A0 svn: E155010: The node '/srv/install/linux/emacs/check-svn/no= t-here' was not found. because the svn command issued was: =C2=A0=C2=A0 >>> svn propset svn:ignore '123' '/srv/install/linux/emacs/ch= eck-svn/not-here' > Now, vc-dir-ignore indeed ignores only one file, but since a file name > is a special case of a wildcard, No, it is not, which is the entire point ;-) Assume you have three files named =C2=A0 test5.xx =C2=A0 test6.xx =C2=A0 test[56].xx Right now, when I move to the line showing "test[56].xx" and press "G", Th= e function `vc-svn-ignore` is invoked with the FILE argument "test[56].xx"= , what do you expect to be ignored? If you say anything else but "test[56].xx", we have a different opinion ho= w the dir-mode UI should work. Currently the result is, that the files "test5.xx" and "test6.xx" are igno= red and the file "test[56].xx" still appears as "unregistered". In order to ignore "test[56].xx", the function call: =C2=A0=C2=A0 >>> (vc-svn-ignore "test\\[56].xx") must be issued. Unfortunately, critisizing use cases does not make such problems go away. = Therefore, the protocol specification should be followed verbatim to imple= ment the ignore function. While glob syntax may actually be an esoteric use case, Hg and its regex s= yntax is not, since the "." is quite common in file names: =C2=A0 myfile.jpg =C2=A0 myfile+jpg Ignoring "myfile.jpg" without proper escaping will also ignore "myfile+jpg= ". While ignoring "myfile+jpg" will not ignore anything. So strictily speaking, yes, a file name is a special case of a wildcard, b= ut a file name as a wildcard does not necessarily match itself. Do you see the problem now? > I wonder why you say there's a need > in an additional argument. Can you elaborate? The additional argument AS-IS is used to write the FILE argument unmodifie= d to the svn:ignore poperty for DIRECTORY, so that a command: =C2=A0=C2=A0 >>> (vc-svn-ignore 'not-here/123' '/srv/install/linux/emacs/c= heck-svn/' t) ;; the t is the additional AS-IS argument would succeed by issuing the appropriate shell command: =C2=A0=C2=A0 >>> svn propset svn:ignore 'not-here/123' '/srv/install/linux= /emacs/check-svn' If you agree, that for the "file path" use case, the file path should be p= roperly escaped, then the difference would be, e.g: =C2=A0=C2=A0 >>> (vc-svn-ignore 'good/test[56].xx' '/srv/install/linux/ema= cs/check-svn/' =C2=A0=C2=A0 svn propset svn:ignore 'test\[56].xx' '/srv/install/linux/ema= cs/check-svn/good' versus: =C2=A0=C2=A0 >>> (vc-svn-ignore 'good/test[56].xx' '/srv/install/linux/ema= cs/check-svn/' t) ;; the t is the additional AS-IS argument =C2=A0=C2=A0 svn propset svn:ignore 'good/test[56].xx' '/srv/install/linux= /emacs/check-svn/good' >> I have already implemented the core handler `vc-default-ignore` replaci= ng the defunct handlers for CVS, Git, Hg, Bzr by parameter sets. The addit= ional parameter set for SRC is also available. I am planning on implementi= ng Mtn. I do not plan on implementing or fixing SVN (or maybe I will). > From my POV, it is much more important to support SVN than to support > Monotone. But that's me. I already decided to adapt the algorithm/modularization to allow a simple = implementation for SVN. >> I would really like to close this thread and open one about the correct= implementation of `vc-ignore`. > Feel free to start a new thread, but I really don't see how that could > be of any help. In particular, this thread discusses a specific bug > (or several related ones), and the new thread will discuss those same > bugs, right? Then it makes little sense to start a new thread about > the same bug. The title suggests that this is about Hg, while the problem affects the en= tire subsystem. But I'm fine either way. > > Thanks. Thank you