GNU bug report logs - #74614
Problem of finding the project root when working on submodules of a submodule

Previous Next

Package: emacs;

Reported by: Chu Maeda <maedaqu <at> gmail.com>

Date: Sat, 30 Nov 2024 02:36:01 UTC

Severity: normal

Fixed in version 31.1

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Chu Maeda <maedaqu <at> gmail.com>, 74614 <at> debbugs.gnu.org
Subject: bug#74614: Fwd: bug#74614: Problem of finding the project root when working on submodules of a submodule
Date: Tue, 3 Dec 2024 04:14:58 +0200
On 02/12/2024 07:15, Chu Maeda wrote:
> 
> Of course, I created such a project on github, you could clone it by 
> command:
> 
> git clone --recurse-submodules https://github.com/chu-mirror/A.git 
> <https://github.com/chu-mirror/A.git>
> 
> The problem is clear when you open the file A/B/C/README.md, and run 
> command project-find-file(C-x p f by default)

Thanks!

It seems we should switch from checking for modules once to doing it in 
a loop. Try this out:

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index cf1c94a6d20..3cc063a5d99 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -591,7 +591,7 @@ project-try-vc--search
                      last-matches))
            vc-handled-backends))
          project)
-    (when (and
+    (while (and
            (eq backend 'Git)
            (project--vc-merge-submodules-p root)
            (project--submodule-p root))

Note you might need to restart Emacs after applying the patch, because 
the directory->project relation is currently cached until restart.




This bug report was last modified 174 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.