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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69547 in the body.
You can then email your comments to 69547 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69547; Package emacs. (Mon, 04 Mar 2024 16:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Patrick Bader <mail <at> patrickbader.eu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 04 Mar 2024 16:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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 1 (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)]

Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Fri, 15 Mar 2024 02:27:01 GMT) Full text and rfc822 format available.

Notification sent to Patrick Bader <mail <at> patrickbader.eu>:
bug acknowledged by developer. (Fri, 15 Mar 2024 02:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 69547-done <at> debbugs.gnu.org (full text, mbox):

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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 12 Apr 2024 11:24:23 GMT) Full text and rfc822 format available.

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

Previous Next


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