GNU bug report logs - #79674
[PATCH] Honor project-vc-ignores when it includes git submodules

Previous Next

Package: emacs;

Reported by: André A. Gomes <andremegafone <at> gmail.com>

Date: Wed, 22 Oct 2025 12:03:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 79674 AT debbugs.gnu.org.

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#79674; Package emacs. (Wed, 22 Oct 2025 12:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to André A. Gomes <andremegafone <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 22 Oct 2025 12:03:02 GMT) Full text and rfc822 format available.

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

From: André A. Gomes <andremegafone <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: dmitry <at> gutov.dev
Subject: [PATCH] Honor project-vc-ignores when it includes git submodules
Date: Wed, 22 Oct 2025 15:02:17 +0300
[Message part 1 (text/plain, inline)]
Hello,

I noticed a bug when setting project-vc-ignores through .dir-locals—when
a directory that is a git submodule is added, it is not ignored.

The attached patch fixes it.

Dmitry Gutov as CC since he's the most suitable person to review it.

Thanks.


-- 
André A. Gomes
"You cannot even find the ruins..."
[0001-Honor-project-vc-ignores-when-it-includes-git-submod.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79674; Package emacs. (Wed, 29 Oct 2025 01:56:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: André A. Gomes <andremegafone <at> gmail.com>,
 79674 <at> debbugs.gnu.org
Subject: Re: bug#79674: [PATCH] Honor project-vc-ignores when it includes git
 submodules
Date: Wed, 29 Oct 2025 03:55:33 +0200
Hi! Thanks for the patch, some questions.

On 22/10/2025 15:02, André A. Gomes wrote:
> +                                            :test (lambda (module ignore)
> +                                                    (string-prefix-p ignore module)))))

What happens if IGNORE is a prefix but not a directory?

Like if MODULE is "foobar" but IGNORE is "foo".

> +                     (let* ((module-dir (concat default-directory module))
> +                            (sub-files
> +                             (project--vc-list-files
> +                              module-dir
> +                              backend
> +                              (mapcar (lambda (ignore)
> +                                        (file-name-as-directory
> +                                         (file-relative-name
> +                                          (expand-file-name ignore)
> +                                          module-dir)))
> +                                      extra-ignores))))

What happens when IGNORE is not a directory? This seems to turn all 
entries there into directories.

Also I'm not clear what will happen when IGNORE is an entry that belongs 
to a different submodule than the one that is currently being processed.

Finally, it would be ideal to avoid 'expand-file-name' here, only 
because it might take non-negligible among of time on large number of 
items, but that could one some double-checking, for realistic number of 
ignore entries anyway.




This bug report was last modified 7 days ago.

Previous Next


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