Subject: bug#74614: closed (Re: bug#74614: Fwd: bug#74614: Problem of finding the project root when working on submodules of a submodule)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 03 Dec 2024 02:40:01 +0000

Your bug report

#74614: Problem of finding the project root when working on submodules of a submodule

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74614: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74614
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74614: Fwd: bug#74614: Problem of finding the project root when working on submodules of a submodule
From: Dmitry Gutov <[email-masked]>
To: Chu Maeda <[email-masked]>
Cc: [email-masked]
Date: Tue, 3 Dec 2024 04:39:35 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 31.1

On 03/12/2024 04:25, Chu Maeda wrote:
> It works. Thanks.

Thanks for testing, pushed to master now in 8534bb2d6b5.

> Dmitry Gutov <[email-masked] <mailto:[email-masked]>> 于2024年12月3 
> 日周二 10:15写道：
> 
>     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>
>      > <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.
> 

Subject: Problem of finding the project root when working on submodules of a submodule
From: Chu Maeda <[email-masked]>
To: [email-masked]
Date: Sat, 30 Nov 2024 10:35:19 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Assume that there's a git repository A. A has a submodule B. B has a
submodule C.

When I'm working on C, the current implementation won't choose A as the
project root even though the project-vc-merge-submodules is non-nil.

I can customize project-find-functions to find the right project root as a
workaround, but I think this might be a bug need to be fixed.