GNU bug report logs - #66806
30.0.50; [PATCH] 'project-find-regexp' passes Git submodules to the search program

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Sun, 29 Oct 2023 05:37:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Fixed in version 30.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: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dmitry <at> gutov.dev, 66806 <at> debbugs.gnu.org
Subject: bug#66806: 30.0.50; [PATCH] 'project-find-regexp' passes Git submodules to the search program
Date: Sun, 29 Oct 2023 10:54:28 -0700
[Message part 1 (text/plain, inline)]
On 10/28/2023 11:06 PM, Eli Zaretskii wrote:
>> Cc: dmitry <at> gutov.dev
>> Date: Sat, 28 Oct 2023 22:36:07 -0700
>> From: Jim Porter <jporterbugs <at> gmail.com>
>>
>> --- a/lisp/progmodes/project.el
>> +++ b/lisp/progmodes/project.el
>> @@ -960,7 +960,8 @@ project-find-regexp
>>            (default-directory (project-root pr))
>>            (files
>>             (if (not current-prefix-arg)
>> -              (project-files pr)
>> +              ;; XXX: See the comment in project-query-replace-regexp.
>> +              (cl-delete-if-not #'file-regular-p (project-files pr))
>                    ^^^^^^^^^^^^^^^^
> I think we want to prefer using seq.el functions, since seq.el is
> nowadays preloaded.  Is there a good reason to use cl-delete-if-not
> here?

Well, that's just copy-pasted from some other functions in project.el. 
If we want to go the minimal route, I could update all those workarounds.

Or we could go the maximal route and fix it at its source. Here's an 
updated patch for the maximal route that uses 'seq-difference'.

Assuming we're ok with the performance characteristics of the maximal 
patch, I think the maximal route is best: it fixes the issue at its 
source. For performance, it should be faster by default, but a bit 
slower when 'project-vc-merge-submodules' is nil (since we need an extra 
call to "git" to get the list of submodules). However, that slowness is 
compensated for by eliminating the need to call 'file-regular-p' on all 
the results for some functions that really do need 'project-files' to 
return only files. (If we're really concerned about *exact* perf 
numbers, I can try to collect some. Just let me know.)
[maximal_0001-Exclude-Git-submodules-from-project-files.patch (text/plain, attachment)]

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

Previous Next


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