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#73801: 31.0.50; project-try-vc sometimes set wrong cache project-vc-extra-root-markers Date: Mon, 28 Oct 2024 06:06:17 +0200 Message-ID: <3b9816c7-bec3-4743-ad1a-49332c158099@gutov.dev> References: 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="3509"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Zhengyi Fu , 73801@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 28 05:07:58 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 1t5H2q-0000l9-Tc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Oct 2024 05:07:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5H2S-0004Q4-AF; Mon, 28 Oct 2024 00:07:33 -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 1t5H2N-0004Pa-3R for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 00:07:27 -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 1t5H2M-000263-MC for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 00:07:26 -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=B3aUW/u9jVzAbzazR2LxoF0lLmU91Aio7OnzmgO4d90=; b=UWpkkihsDci92AinWoeVZePjXTfpMIpT9OB+g/EWjG0WmBy21TNerJmo6na0fHyTWma8V+2EDHjxD3fq4e5GUkLvXpBHS+RrtmnvxWp+sB7uivt5sgZZ5h2+27BAoIMPJEXAYdAMbreRUKDSBBp30KQ2dIeiJDEfQqXkMuCQswcz69aQUbw0Ruw1jS0ZPrZ0fy/Hbz0YdqNpwXKTt5Jo4QaOJXW5JIIWgVWmwaX1vd55WJZtsrWTrYZhYPMI4aQtSGnTYp5fcqW+EmyJkaqL2hVEfAkFB9z5J4feHyPZshs2cYtfhtS6JvS4SjNRQmHFxRGcHZwMh0xbq/v3R9HuLg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t5H2w-000497-8R for bug-gnu-emacs@gnu.org; Mon, 28 Oct 2024 00:08:02 -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, 28 Oct 2024 04:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73801 X-GNU-PR-Package: emacs Original-Received: via spool by 73801-submit@debbugs.gnu.org id=B73801.173008842415793 (code B ref 73801); Mon, 28 Oct 2024 04:08:02 +0000 Original-Received: (at 73801) by debbugs.gnu.org; 28 Oct 2024 04:07:04 +0000 Original-Received: from localhost ([127.0.0.1]:50071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5H1z-00046f-FI for submit@debbugs.gnu.org; Mon, 28 Oct 2024 00:07:03 -0400 Original-Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]:60997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t5H1w-00045o-Uv for 73801@debbugs.gnu.org; Mon, 28 Oct 2024 00:07:01 -0400 Original-Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id EC2D913801B5; Mon, 28 Oct 2024 00:06:19 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Mon, 28 Oct 2024 00:06:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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=1730088379; x=1730174779; bh=B3aUW/u9jVzAbzazR2LxoF0lLmU91Aio7OnzmgO4d90=; b= kgoEOisHctyKXavPkZk6Ys0S66ul/srqhW1CuCrUHDCSvyS+N1LuZwAhEnVEzm4C 9btXZbi3PoF7u3MSLPqeH/U59Q+btiewGYyUZv23fS7ohOgq9B10URuzs+xYaO1i bAxGKfFBSpxv0QaNGyQcjdRt3R0PJZvAj4BSKgTkdFc0npSfv7qjAF1IgQSvrdeS 8txPgUEORQuWWVOf/j4U7EpamN/IXHtwjoAtH60a/9l00z7ugOiMBfiJ/Fc7qgZX cNPYM/MuL0M9KPw1dYCHBbqBNlfuAWo7wCdD6EOEtGmzXPmTZwP3yIsOuRzRSi6t ZgykmeEYwKnFFvq+6L6YnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=fm3; t=1730088379; x= 1730174779; bh=B3aUW/u9jVzAbzazR2LxoF0lLmU91Aio7OnzmgO4d90=; b=W bMfW2SM/jpELfhi+zi36iEuXISzQdXglJu+z11CP/jiAuSOGZNuXUgNKW32rA/8o hzgzJ7WLu+TuDTYp0lCT+QBhh0h8YzlmueRwCk4RP3ZiZX5/eiKRT4ANlGMtpDB3 RAbnGPlYZaCFHSWBcdfVROYwN3xBHaVCocF6rSZ0XEdOQ7gdStftNs73hTsRpvSx O07VEV8if3SUfoXW+evT7nMVOYCJP3oxn8ha539jPwEJutWeo5V9psHeHYVQwaiB nT75Nd4/PEBly1oMBm0yTkXTGQFFarde9FetCSTsiD4hTOlm8rVFhtU+8X9AREPv r1yq1/TukwLVIEXVe3HSA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdejjedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg fuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcu oegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvghrnhepgeeugeetff duvdejvedvleeliedtfedtudfhfeefffejudekveejvdeffffgveegnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtoh hvrdguvghvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphht thhopehisehfuhiihidrmhgvpdhrtghpthhtohepjeefkedtudesuggvsggsuhhgshdrgh hnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 28 Oct 2024 00:06:18 -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:294409 Archived-At: Hi! Thanks for the report. On 14/10/2024 09:29, Zhengyi Fu wrote: > Consider the following project: > > test-project/ > ├── .git/ > └── subproject/ > ├── marker > └── subdir/ > > If `project-vc-extra-root-markers' is set to `("marker")' and > `project-try-vc' is invoked with `test-project/subproject/subdir', it will set the `project-vc' > VC property of the `test-project/subproject' directory to > `(".../test-project" project-vc nil)', so if later `project-try-vc' is > invoked with that directory, it will return a wrong result. > > This is because project-vc tries to detect the VC backend by invoking > `project-try-vc' on the subproject while let binding > `project-vc-extra-root-markers' to nil and the result is cached. > > The following patch can fix the problem: > > --- a/lisp/progmodes/project.el > +++ b/lisp/progmodes/project.el > @@ -595,7 +595,7 @@ project-try-vc > (let* ((project-vc-extra-root-markers nil) > ;; Avoid submodules scan. > (enable-dir-local-variables nil) > - (parent (project-try-vc root))) > + (parent (project-try-vc dir))) > (and parent (setq backend (nth 1 parent))))) > (setq project (list 'vc backend root)) I've pushed a different fix in commit 29b30eb49f8 (with slightly better performance, I think). Please try it when you can. It would be nice to get either of the patches into Emacs 30, too, but it might be a little late given where it is in the pretest.