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: Sat, 22 Feb 2020 14:46:16 +0100 Message-ID: References: <1ba53ae2-42a4-3ab3-d4f2-2ceae565d198@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> <5622487d-a21f-49cf-5420-21f87415af4f@gmx.de> <83wo8ubfbo.fsf@gnu.org> <83zhdpqbas.fsf@gnu.org> <2c8419ae-723d-c7ae-a60e-59d1b1cbc2c1@gmx.de> <83o8u3r6wg.fsf@gnu.org> <6f3ba261-e1f9-cf19-cc22-ec8c24cf3298@gmx.de> <83blq2qzqp.fsf@gnu.org> <83ftfdplo8.fsf@gnu.org> <9929b44f-37da-23c8-16cc-c6ca89602149@yandex.ru> <2f84ddff-3275-6eb1-01ae-ff1d28b6e8da@gmx.de> <835zfzjcbv.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="16243"; 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 Sat Feb 22 14:47:52 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 1j5V8J-000460-Ey for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Feb 2020 14:47:51 +0100 Original-Received: from localhost ([::1]:42974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5V8I-000839-7c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Feb 2020 08:47:50 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43388) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5V7X-00082y-S4 for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2020 08:47:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5V7W-0000Vh-4K for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2020 08:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5V7W-0000VR-1E for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2020 08:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j5V7V-0001gL-V9 for bug-gnu-emacs@gnu.org; Sat, 22 Feb 2020 08:47: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, 22 Feb 2020 13:47: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.15823791886422 (code B ref 37189); Sat, 22 Feb 2020 13:47:01 +0000 Original-Received: (at 37189) by debbugs.gnu.org; 22 Feb 2020 13:46:28 +0000 Original-Received: from localhost ([127.0.0.1]:48690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5V6x-0001fW-Sv for submit@debbugs.gnu.org; Sat, 22 Feb 2020 08:46:28 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:35537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j5V6w-0001fF-0V for 37189@debbugs.gnu.org; Sat, 22 Feb 2020 08:46:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1582379179; bh=OHBQvSJ+LCJwZubCHIBkOhrN0X/WpfWyVMS5WZF6EvM=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Jb7VJt/jJ/XlAlp6svoU6VLRy9rFOcwtN/MFAF0wBbC/PQjm524lF5wJyZvBQfnaf pSGm0sQKWXkxcIGxEROr0pxt4Re2ki+stYMiVjnBuqw4tWSkKj0D2xCE96AkoPXXt6 EDGWCMf7rgwgxkniOx1t0nsXxECuG50DwCl11Ln4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from sheckley.simul.de ([87.160.210.52]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTAFh-1j0KJg2S8V-00UXBP; Sat, 22 Feb 2020 14:46:19 +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 0E1EF19431F1; Sat, 22 Feb 2020 14:46:16 +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: <835zfzjcbv.fsf@gnu.org> Content-Language: de-DE X-Provags-ID: V03:K1:/YVrF6QYDJNm4aSYznd/gpUcIeWu7PNGpaML3xzN8Wbog/twhGh 83XQzVr23K1Xto56H5I+5sega74Yu5KZJYjmRSS1CWJad2pj/GApzBtfV0v5trroeFg0qrR nkp4f4k1W4WXVU62IiRv3dTE4A9hg3vxbltnxxcG3FleAVgzqNc20XS2N8I7wrKQ/QpNVSx ldNWBRocTct07vcaQgRbw== X-UI-Out-Filterresults: notjunk:1;V03:K0:z6FEYOfKc/8=:xpTC2XIArF9CYoN6/VBDqk /t3zNpUX53LKwaKKNg0xtQjeCUF90ZXH4/NefCd/gJqo9ZTZH2Gqyzj16Olrn0hCAW3ft5HtG AtKV18ahrJYX6ZaSIu0qu8DwVjajNDMSNYY+WbCiUsb+jU9fpoNcZ3aUD2MUZGcmVYw6hkpMR D5AesfBYjRkc9o+c+T2pcmuaDzRiBX0csP53yQ30fK2N1RGKHi97zg7pbgauaFbG9C2GQVtnZ ev3jJxfKlVj43NxGcXdWYyOo3ey3FDtNYTESGmRGacjDfZpF/x3mwlR6sxxURSL5rF5Ui01z4 eYfZC8gaf8s2PLDg1oZnOl+NavJL4NsoScOOX5ZQZDj7uAZk5fvZKA6w5SYBD1Fx/gkiwDyDM vwpXsUlx1/9BXwAEaCXnLRA5KbE+j3xIoGNuQGLHoffnodELdxAW1Bh9AoHGhYKwTJhkAj1B7 BhLIHF9tm4tKyk9LAKQxlfuGisHQDa3AvTf+d/Ph/ZQMP+iv0Q7KXNQVFIcU5yUwiaWGACDID Ogu9o1bCvk33l2vjGiAqsYpWdlOLspeq/LjK+3BGF1/weJTkDdEzckKcgzHnZF38hWtnYUvaz BRF0NF8CLTMMK2ZKxZCgkecU2jCRGcMIWlxQwuEMhP53wPeLcmj/QsnZy9UAAIyWQF1E/kxEH eE8v3diVejekmDEZ68FrLnRSqibOMZGOYi5krOmGoodflktSdHe5Fz2oj6Xnvh3LfnEW0YM/x F5jwdB/w8cznEs/BQpNw3573sbtfYJhmACMb5M1SGdCXdvJh4xyWg7sTaAQlmqladQ9xePXM 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:176395 Archived-At: Am 22.02.20 um 08:44 schrieb Eli Zaretskii: >> Cc: 37189@debbugs.gnu.org >> From: Wolfgang Scherer >> Date: Fri, 21 Feb 2020 23:22:18 +0100 >> >>> Now, one could argue that one use case is more important than the othe= r one, and that vc-ignore has for a while been geared toward entering plai= n file names rather than glob patterns. I have little opinion on this subj= ect, however, since I mostly edit ignore files by hand, and do so very rar= ely. So as far as I'm concerned, we could remove this feature altogether a= nd not lose much. >> Both use cases are important for casual users of a VC. > I think the issue is not such general, but a more specific one: is the > use case of ignoring patterns more important than ignoring particular > files, when we are talking about usage through VC? How would you measure the importance? When files are properly escaped, it is possible to emulate patterns by ignoring all matching files separately without knowing the exact pattern syntax. This reduces the effort to marking the appropriate files and pressing=C2=A0 C-u G=C2=A0 in vc-dir-mode. The other way around is a lot harder, since it fails without a working knowledge of ignore patterns in the context of a specific VCS. As you demonstrate below for SRC. My personal strategy with Mercurial has been to use the ignore file feature (in DVC) to get a properly escaped file path, then edit =C2=A0.hgignore=C2=A0 to modify the full path to work as a pattern. So, ye= s I can do very well without the pattern use case, but not really without the file path use case. >> SRC has ignore files similar to CVS and SVN. > That's not my reading of the SRC source, which simply does > > if line.startswith("#") or not line.strip(): > continue > elif line.startswith("!"): > ignorable -=3D set(glob.glob(line[1:].strip())) > else: > ignorable |=3D set(glob.glob(line.strip())) > > and the Python documentation, which says: > > glob.glob(pathname, *, recursive=3DFalse) > > Return a possibly-empty list of path names that match pathname, > which must be a string containing a path specification. pathname > can be either absolute (like /usr/src/Python-1.5/Makefile) or > relative (like ../../Tools/*/*.gif), and can contain shell-style > wildcards. Broken symlinks are included in the results (as in > the shell). Whether or not the results are sorted depends on the > file system. You are reading this correctly. > So Git-style root-directory-only .srcignore files will do for SRC. > Which doesn't surprise me at all, because SRC in general copycats > Git's behavior in many aspects. However, your conclusion is unfounded. You need a root directory and recursion for Git-style glob patterns. SRC is RCS/SCCS revisited with a modern frontend. It is - just like RCS and SCCS - not recursive. None of its commands work recursively. There is also no notion of a root directory, i.e. SRC **never** checks a parent directory for ignore patterns, which would be necessary for a Git-style glob to work. Here is a quote from SRC's mission statement: http://www.catb.org/~esr/src/FAQ.html: =C2=A0=C2=A0=C2=A0 You are certainly free to suggest features, but SRC is = developed =C2=A0=C2=A0=C2=A0 with extreme conservatism as to what features to implem= ent or =C2=A0=C2=A0=C2=A0 not. Remember, single-file, single-user, private VCS. This means implicitely, that there is no recursion into sub-directories by design. The=C2=A0 vc=C2=A0 package just emulates recurs= ive operation for RCS, SCCS, SRC. This works fine for RCS and SCCS, since RCS can be invoked on files in a subdirectory and works properly, e.g.: =C2=A0=C2=A0=C2=A0 rcs log sub/data However, SRC currently fails in that scenario, actually destroying the repository identity. Which also means, that operations on sub-directories in=C2=A0 vc-dir-mode=C2=A0 fail destructively. I have not = yet reported this issue for Emacs, but to ESR at https://gitlab.com/esr/src/issues/14, to see, whether SRC can be repaired. If SRC is not repaired, it would probably be best to disable recursive operations in=C2=A0 vc , since the patch to repair=C2=A0 vc-src.el=C2=A0 i= s a bit ugly and the result is not even close to perfect (https://gitlab.com/esr/src/uploads/ca532d65dbb07afcb2144afbded1b368/0001-= Run-SRC-commands-separately-and-normalized-for-each-.patch). >>> Roughly and handwavy, we can take this case to mean "use default-direc= tory". >> Unfortunately not. If the file or pattern to be ignored is in a >> subdirectory of default-directory, the DIRECTORY argument must reflect >> this for CVS, SVN, SRC. > But since CVS and SVN don't use vc-default-ignore, and SRC can do with > a single file in the root of the repository, does it really matter in > practice? IMHO, the goal should be to eliminate both vc-svn-ignore and vc-cvs-ignore, replacing the functionality by low-level backend functions, which is perfectly possible, iff the ignore file / ignore directory is correctly identified: vc-cvs-find-ignore-file, vc-svn-ignore-file (just to identify the directory), vc-svn-add-line, vc-svn-remove-line (or a combined handler for addition and removal). This also results in cheap ignore file support for SRC with a single function vc-src-find-ignore-file. It also means, that escaping/anchoring does not have to be integrated in 3 or 4 places but only once in vc-default-ignore or vc-ignore.