From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#72300: project.el: detect newly created project contained within another Date: Tue, 1 Oct 2024 02:10:31 +0300 Message-ID: <6423009d-777f-453d-94e0-22c095b62d9a@gutov.dev> References: <87r0bh8cy7.fsf@gmx.de> <86mslssny9.fsf@gnu.org> <04986428-27b5-462d-8f89-139cd56ea117@gutov.dev> <4ecab405-a03f-4dd7-af4b-f2d29b0420a4@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2030"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 72300@debbugs.gnu.org, Eli Zaretskii , Federico Tedin To: Ship Mints Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 01 01:11:52 2024 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 1svPYV-0000KF-6o for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Oct 2024 01:11:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svPYB-0001qk-59; Mon, 30 Sep 2024 19:11:31 -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 1svPY9-0001qa-Sv for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 19:11:29 -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 1svPY9-0000yu-KC for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 19:11:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=vK8pRjwzl8kkYU62UQjLx3U4i4R1RmzvytHDUeB0Q2k=; b=TiMx/Zsk3Wy2gODx4Y8YE67Qbdi0G0Y28ZaP4fo9EAbcE0WXHHYvc8YkUh66FuzR21TyVfLFbeiWT1RjBFlQtR1TxYW7pHm2v2gogyX3Vemos6d3pHxZ79AhOEdmPF+z8ClGLDggEqgw7lfLHr4NOU8Se2bR/IUgL6SmnOhy/1UdBg43We3TtciwsDt9JPkniHpuuYIiOdEOkBfT5vC53qL7vyodPtcUYP2LlnamobDEF9TEqgVtEjzoQwKHXYsgS+v/p32GeF6GiHGa4BTFp19rjfq+JhNchUdc9+NaiTtlIX+gA97RzCKlANsDr0YF/bikppnYXNEy1GllBDyemQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svPYf-0003sz-VF for bug-gnu-emacs@gnu.org; Mon, 30 Sep 2024 19:12:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Sep 2024 23:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72300 X-GNU-PR-Package: emacs Original-Received: via spool by 72300-submit@debbugs.gnu.org id=B72300.172773787914909 (code B ref 72300); Mon, 30 Sep 2024 23:12:01 +0000 Original-Received: (at 72300) by debbugs.gnu.org; 30 Sep 2024 23:11:19 +0000 Original-Received: from localhost ([127.0.0.1]:47663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svPXy-0003sN-SR for submit@debbugs.gnu.org; Mon, 30 Sep 2024 19:11:19 -0400 Original-Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]:35565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svPXt-0003sD-Kn for 72300@debbugs.gnu.org; Mon, 30 Sep 2024 19:11:17 -0400 Original-Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 157F51380A3E; Mon, 30 Sep 2024 19:10:35 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 30 Sep 2024 19:10:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727737835; x=1727824235; bh=vK8pRjwzl8kkYU62UQjLx3U4i4R1RmzvytHDUeB0Q2k=; b= a4IWk7ZzSacrvR8i1FIgYFM3O9StMv8BFv2gyHNEoIPCkQVwlKBnn+Q5Y3gR90FM C1cK8Aojwb0KOquDjAC0t/GcYLxsTnybn6P9Vtoe15cmutloRg9Ng6qL3+PHWZ68 AQMo2VLRY1B/K2en6USGv3f0Py5lVOY3HecYg5cyyE/+OQGEI+wl6xO9SdiFG+qn HXUad6DngjeylhActOZR4DmGBZYbF/uGc99rTxtnQxeWzdK+LAyJTMS8Oolx8oWu JUxtSopvI/slQmuexkHsljlRWTJPNOUG3CL2B69uF1UH9NtearBO0VBhn3jkiU06 jiNfdwaWes40MyMxour21g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727737835; x= 1727824235; bh=vK8pRjwzl8kkYU62UQjLx3U4i4R1RmzvytHDUeB0Q2k=; b=g LdzUgQ7AD74EVjnKqkGw81ZEAUM39mcS+Fk6qIrIYUycUhLe2WXcMpaZPpxeOOzP NGXIB5Na/ey1mPdvnEreLXzBaz8bVuagaSC8GjXG8PAKPV5YBlO+xhryrHgnYelb 07/sHeQCDh1UTH+gCJCp5DeDdKe06NSoUR1L2a4zvpFNekoOgzOTgzvML7rtVEGA GFv0r/Sg3rheTUULgekxSwC2Goqxu5Dm0ZYW4hl+5nYOcLgOGnlldcllb7C6U6kL dqEYzqqRjgwlcma/6jURitkDXLrw5NqX1HhBsgfonGr+1ZNt6qIX6K5VNZBffFQc 0ZbKTW1vnJ4NSI84RfQLA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduiedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdrug gvvheqnecuggftrfgrthhtvghrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveeg tedthefhudekteehffeukeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthho peegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehshhhiphhmihhnthhssehgmh grihhlrdgtohhmpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpdhrtghpthhtohep fhgvuggvrhhitghothgvughinhesghhmgidruggvpdhrtghpthhtohepjedvfedttdesug gvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 Sep 2024 19:10:33 -0400 (EDT) Content-Language: en-US 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:292743 Archived-At: On 30/09/2024 17:31, Ship Mints wrote: > Git attributes is a possible approach, with a downside of extra process > calls, which over Tramp (for example) would mean additional latency. > > > (defun project--value-in-dir (var dir)already incurs latency over tramp, > right? Yep, but almost every other separate I/O adds to it. So with other things equal, I'd prefer solutions with fewer disk reads - at least for the default behavior. > How about we just support filtering out submodules using the > project-vc-ignores var? Which can be assigned in .dir-locals.el or > through other means. > > > Seems simple. Perhaps an abnormal hook so people can customize buffer > local hook via dir locals? If they want to use git attributes, they > could integrate that approach as an added/replacement function. The > function list could default to a function that implements current behavior. I'd like to say yes, but what would be a good place and name for that hook? Note there is an existing hook called before-hack-local-variables-hook which allows one to alter the applied local variables. But that one might run more often than ideal - perhaps try it out and report back. Another approach might use a custom project backend which wraps the existing project-vc - it would need to provide a custom implementation for 'project-ignores' and could delegate the rest of the methods to the parent. BTW, are you asking about using git attributes because there is an existing workflow that somehow hooks into it, at some of your clients? If not, then editing dir-locals.el to set the value of project-vc-ignores directly seems like an easier approach.