From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Zhengyi Fu Newsgroups: gmane.emacs.bugs Subject: bug#73801: 31.0.50; project-try-vc sometimes set wrong cache project-vc-extra-root-markers Date: Mon, 14 Oct 2024 14:29:48 +0800 Message-ID: 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="572"; mail-complaints-to="usenet@ciao.gmane.io" To: 73801@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 14 10:16:29 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 1t0GFh-000AXZ-HE for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Oct 2024 10:16:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0GFa-0006cO-LQ; Mon, 14 Oct 2024 04:16:22 -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 1t0GF2-0006Ya-QT for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2024 04:15:50 -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 1t0GF1-0004bU-4H for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2024 04:15:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=pMeIpjz9IDxcjvYnYSeWGcLBeIJNUAJsNUErBIkOv1s=; b=GLkhQd/tBXC99EYFY5pd4BvbZ4ZB4km9N4tuTn/Ell27Ind8QWcc+FMyWjWZX48wh+L98LllptAvUWI+ajm87Q87ig62Nh37Y7Ca4vlUK+PA13iIa7U8XCnmjS8xp+I7EPa9ezZC45Rd7pipR/6+Wp+iqu4+YxAqXLpwno+5LC3Q5ic6kYhzNLJrUadafijI6sK5tNrnWup92erQ38DxckqrUU7C9uVU1Ttdm/gXZcDCiKDHDqXDoDBJhMPnLH2d8r4HWvw5zpAR1aZWvBKqeHhIio/t/jOK7gPOp2rKcjB2II5M35RZSY1r6SOZA14Mqvbf3DCyA5FiiS7O0M6VUg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t0GFH-0002Zj-JS for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2024 04:16:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Zhengyi Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Oct 2024 08:16:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73801 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17288937629883 (code B ref -1); Mon, 14 Oct 2024 08:16:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Oct 2024 08:16:02 +0000 Original-Received: from localhost ([127.0.0.1]:35233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t0GFF-0002Z7-Lo for submit@debbugs.gnu.org; Mon, 14 Oct 2024 04:16:02 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:54462) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t0Edj-0003g7-MY for submit@debbugs.gnu.org; Mon, 14 Oct 2024 02:33:13 -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 1t0EdN-0001yq-Jc for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2024 02:32:51 -0400 Original-Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0EdK-00013f-Qk for bug-gnu-emacs@gnu.org; Mon, 14 Oct 2024 02:32:49 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 9CC50240004 for ; Mon, 14 Oct 2024 06:32:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fuzy.me; s=gm1; t=1728887561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pMeIpjz9IDxcjvYnYSeWGcLBeIJNUAJsNUErBIkOv1s=; b=ZC+eqmemVGO/YDt1cByG+b63FMs4uyeCNawrrLSRrnBCXILjp0OhbsLE8zrlOxMs3k2zLP bgvTiJjdMFoM8kDYbhIQEItpXd3NyUUVclC8R4bXEqiNGoDbgV0usw8J/UvSVZ1QKr8QP9 WyNf6ffl0uQ+LCg/afHC9+Izh8LPpbzPE6anmu4bOx4xec/U721HTr4e/XKLy7SQ/rmxGs ZeaR+6/1HzL9EtZuEFCGO5aaFwbYuUyzs5cQl2vhznJDJ6AuAiaE84lBaorGIsVx5VLDKt iiZO9knTPlkmFwYseK4jmQ5NpQ7eZ4qL7CJfXl0A7Y6h4YVgXhI9FkYWM9u9fg== X-GND-Sasl: id@fuzy.me Received-SPF: pass client-ip=2001:4b98:dc4:8::221; envelope-from=i@fuzy.me; helo=relay1-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 14 Oct 2024 04:15:59 -0400 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:293564 Archived-At: Consider the following project: test-project/ =E2=94=9C=E2=94=80=E2=94=80 .git/ =E2=94=94=E2=94=80=E2=94=80 subproject/ =E2=94=9C=E2=94=80=E2=94=80 marker =E2=94=94=E2=94=80=E2=94=80 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)) ;; FIXME: Cache for a shorter time.