From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Cassou Newsgroups: gmane.emacs.bugs Subject: bug#65704: 29.1; Most code of `project-ignores' seems to be dead code Date: Mon, 04 Sep 2023 18:03:04 +0200 Message-ID: <874jkakjt3.fsf@cassou.me> References: <87sf7wlg07.fsf@cassou.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29344"; mail-complaints-to="usenet@ciao.gmane.io" To: Dmitry Gutov , 65704@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 04 18:04:42 2023 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 1qdC4A-0007My-KI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Sep 2023 18:04:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdC3Y-0007FV-P5; Mon, 04 Sep 2023 12:04:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdC3W-0007Eb-Ap for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2023 12:04:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdC3V-0004vD-Tp for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2023 12:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdC3V-0006h1-I4 for bug-gnu-emacs@gnu.org; Mon, 04 Sep 2023 12:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Damien Cassou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Sep 2023 16:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65704 X-GNU-PR-Package: emacs Original-Received: via spool by 65704-submit@debbugs.gnu.org id=B65704.169384339125639 (code B ref 65704); Mon, 04 Sep 2023 16:04:01 +0000 Original-Received: (at 65704) by debbugs.gnu.org; 4 Sep 2023 16:03:11 +0000 Original-Received: from localhost ([127.0.0.1]:52384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdC2g-0006fS-S1 for submit@debbugs.gnu.org; Mon, 04 Sep 2023 12:03:11 -0400 Original-Received: from mail.choca.pics ([80.67.172.235]:59824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdC2e-0006fE-D6 for 65704@debbugs.gnu.org; Mon, 04 Sep 2023 12:03:09 -0400 Original-Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 4CA1618193FAB; Mon, 4 Sep 2023 18:03:06 +0200 (CEST) Original-Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10032) with ESMTP id AodS3OmTAgJQ; Mon, 4 Sep 2023 18:03:05 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 8B41718193FAC; Mon, 4 Sep 2023 18:03:05 +0200 (CEST) X-Virus-Scanned: amavis at choca.pics Original-Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavis, port 10026) with ESMTP id qf6uT-hmWjfI; Mon, 4 Sep 2023 18:03:05 +0200 (CEST) Original-Received: from localhost (91.60.75.86.rev.sfr.net [86.75.60.91]) by mail.choca.pics (Postfix) with ESMTPSA id 17D1518193FAB; Mon, 4 Sep 2023 18:03:05 +0200 (CEST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269258 Archived-At: Dmitry Gutov writes: > much. Maybe just that that code path isn't exercised by any in-tree > function if the backend is Git (with recent enough git installed) My Git repository has several .gitignore files in several directories, something that `project-ignores' (for VC) seems to not support: ;; we only support .gitignore at the root. My project looks like this: . =E2=94=9C=E2=94=80=E2=94=80 client =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 .gitignore =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 node_modules =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 .project =E2=94=9C=E2=94=80=E2=94=80 .git =E2=94=94=E2=94=80=E2=94=80 .gitignore Because I spend most of my time in the client/ directory, I want the `project' library to consider client/ to be a project on its own. I use the code below and the client/.project file to do this: (defconst my/project-root-marker ".project" "File indicating the root of a project.") (defun my/project-find-root (path) "Search up the PATH for `my/project-root-marker'." (when-let* ((root (locate-dominating-file path my/project-root-marker= ))) (cons 'transient root))) (add-to-list 'project-find-functions #'my/project-find-root) The client/.gitignore file contains a line "node_modules/" which is a very large directory. The command `project-find-file' doesn't see my client/.gitignore and thus suggests 83k files and make the completion UI very slow. So I'm not using it but this instead: (project-find-file-in (thing-at-point 'filename) (list "/my/project/client") (project-current nil "/my/project")) The function `project-find-file-in' uses `project-files' which in turn uses `project--dir-ignores'. The later uses `project-ignores' which has the bug mentioned in this issue. Am I doing something reasonable? Is there a better way? It looks like a lot of setup to get Emacs to ignore directories listed .gitignore files. --=20 Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill