GNU bug report logs - #69547
29.2; project root directory is wrong for submodules of worktrees

Previous Next

Package: emacs;

Reported by: Patrick Bader <mail <at> patrickbader.eu>

Date: Mon, 4 Mar 2024 16:06:01 UTC

Severity: normal

Found in version 29.2

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#69547: closed (29.2; project root directory is wrong for
 submodules of worktrees)
Date: Fri, 15 Mar 2024 02:27:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 15 Mar 2024 04:25:46 +0200
with message-id <c9791c17-fff6-42f2-914c-c07a1b61496b <at> gutov.dev>
and subject line Re: bug#69547: 29.2; project root directory is wrong for submodules of worktrees
has caused the debbugs.gnu.org bug report #69547,
regarding 29.2; project root directory is wrong for submodules of worktrees
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
69547: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69547
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Patrick Bader <mail <at> patrickbader.eu>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.2; project root directory is wrong for submodules of worktrees
Date: Mon, 4 Mar 2024 16:21:48 +0100
[Message part 3 (text/plain, inline)]
Hi,

when navigating to a file in a git submodule, the project root stays in 
the parent repository.
If the submodule is part of a git worktree, however, this does not work 
as expected and the project root switches to the directory of the 
submodule itself.

The issue seems to be how project--submodule-p is checking whether the 
current repository is a submodule.
In the worktree case, there is the worktree path between the .git and 
modules directory in the gitfile.
There may also be regular directory names before the .git directory 
apart of "../".

I have attached a patch to fix this.

Best,

Patrick

[0001-fix-project-submodule-detection-does-not-work-for-wo.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Patrick Bader <mail <at> patrickbader.eu>, 69547-done <at> debbugs.gnu.org
Subject: Re: bug#69547: 29.2; project root directory is wrong for submodules
 of worktrees
Date: Fri, 15 Mar 2024 04:25:46 +0200
Hi!

On 04/03/2024 17:21, Patrick Bader wrote:
> when navigating to a file in a git submodule, the project root stays in 
> the parent repository.
> If the submodule is part of a git worktree, however, this does not work 
> as expected and the project root switches to the directory of the 
> submodule itself.
> 
> The issue seems to be how project--submodule-p is checking whether the 
> current repository is a submodule.
> In the worktree case, there is the worktree path between the .git and 
> modules directory in the gitfile.
> There may also be regular directory names before the .git directory 
> apart of "../".
> 
> I have attached a patch to fix this.

Thanks! Installed.


This bug report was last modified 1 year and 127 days ago.

Previous Next


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