Subject: Re: bug#55396: 29.0.50; project-find-file don't work on a project with many submodules

From: Dmitry Gutov <[email-masked]>
Date: Mon, 13 Jun 2022 01:17:28 +0300

Hi again, sorry for the delay.

On 13.05.2022 15:56, Eason Huang wrote:
> And I try to start emacs with `emacs -q`, set `(setq debug-on-errort)`.
> Then reproduce the issue, will get the following debug error:
> 
> Debugger entered--Lisp error: (excessive-variable-binding)
>    call-process("git" nil (t nil) nil "--no-pager" "ls-files" "-z" "-c" "-o" "--exclude-standard")
>    process-file("git" nil (t nil) nil "--no-pager" "ls-files" "-z" "-c" "-o" "--exclude-standard")
>    vc-git--call((t nil) "ls-files" "-z" "-c" "-o" "--exclude-standard")
>    vc-git--out-ok("ls-files" "-z" "-c" "-o" "--exclude-standard")
>    vc-git--run-command-string(nil "ls-files" "-z" "-c" "-o" "--exclude-standard")
>    project--vc-list-files("/Users/eason/.emacs.d/lib/aggressive-indent" Git nil)
>    #f(compiled-function (module) #<bytecode 0xfc6c01609385f70>)("lib/aggressive-indent")
>    project--vc-list-files("/Users/eason/.emacs.d/." Git nil)
>    #f(compiled-function (module) #<bytecode 0xfc6c01609385f70>)(".")
>    project--vc-list-files("/Users/eason/.emacs.d/." Git nil)
>    #f(compiled-function (module) #<bytecode 0xfc6c01609385f70>)(".")
>    project--vc-list-files("/Users/eason/.emacs.d/." Git nil)
>    #f(compiled-function (module) #<bytecode 0xfc6c01609385f70>)(".")
>    project--vc-list-files("/Users/eason/.emacs.d/." Git nil)

Looking at the backtrace again, it seems the problem is not related to 
the number of submodules. It's a plain infloop.

Could you try to help with debugging? Alternatively, you could provide a 
simple repo with this problem that doesn't require Borg to initialize. 
Though it probably doesn't (shouldn't) require Borg anyway, given how 
the problem looks.

What does project--vc-list-files do in your case? It calls 'git 
ls-files' to fetch the list of files in the parent repo, then parses the 
list of submodules in it, and repeats the same call inside each 
submodule (using (concat default-directory module) as target).

Looking at the backtrace, it mentions "/Users/eason/.emacs.d/." over and 
over again. So it seems like (project--git-submodules) returns a list 
which has "." as one of its elements.

How does that happen? Do you have a submodule entry which points to "."?