unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eason Huang <aqua0210@foxmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 55396@debbugs.gnu.org
Subject: bug#55396: 29.0.50; project-find-file don't work on a project with many submodules
Date: Mon, 13 Jun 2022 23:00:25 +0800	[thread overview]
Message-ID: <tencent_97E3B59DCD0CB9C497AE1217A4CB8D38F007@qq.com> (raw)
In-Reply-To: <e761337c-782c-9df3-ea34-a349a519ae0a@yandex.ru> (Dmitry Gutov's message of "Mon, 13 Jun 2022 01:17:28 +0300")

Dmitry Gutov <dgutov@yandex.ru> writes:

Hi Dmitry,

Thanks for reply.

> 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.

I create an simple which only include a submodule, I take vertico for
example. you can get it here:

https://github.com/Eason0210/sample-project.git

Steps to reproduce the issue:

1. Create an empty folder call `.emacs.d` (The name is not matter, you
can use any name)

2. cd .emacs.d, and let's say i want to add vertico as an submodule

```
git init
git submodule add --name vertico git@github.com:minad/vertico.git lib/vertico
git add .
git commit -m "add vertico"
```
3. so far so good.
4. Modify the .gitmodules file, add load-path for extensions directory
of vertico repo

```
[submodule "vertico"]
	path = lib/vertico
	url = git@github.com:minad/vertico.git
	load-path = .
	load-path = extensions
   #+end_src
```
5. Now perform ~M-x, project-find-file~ in the .emacs.d directory will
cause the issue.



> 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).

I try 'git ls-files .' in vertico submodule in iterm and get this:

```
➜  vertico git:(main) git ls-files .
LICENSE
README.org
extensions/vertico-buffer.el
extensions/vertico-directory.el
extensions/vertico-flat.el
extensions/vertico-grid.el
extensions/vertico-indexed.el
extensions/vertico-mouse.el
extensions/vertico-multiform.el
extensions/vertico-quick.el
extensions/vertico-repeat.el
extensions/vertico-reverse.el
extensions/vertico-unobtrusive.el
vertico.el
```

```
➜  vertico git:(main) git ls-files extensions
extensions/vertico-buffer.el
extensions/vertico-directory.el
extensions/vertico-flat.el
extensions/vertico-grid.el
extensions/vertico-indexed.el
extensions/vertico-mouse.el
extensions/vertico-multiform.el
extensions/vertico-quick.el
extensions/vertico-repeat.el
extensions/vertico-reverse.el
extensions/vertico-unobtrusive.el
```

> 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 "."?
>

I found that it's this line `load-path = .` cause the issue. Borg need
this line to add the vertico directory to load-path when user add a
subDirectory to load-path. May be it is an issue of Borg?


-- 
Eason Huang





  reply	other threads:[~2022-06-13 15:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 12:56 bug#55396: 29.0.50; project-find-file don't work on a project with many submodules Eason Huang
2022-05-15  1:48 ` Dmitry Gutov
2022-05-15  4:09   ` Eason Huang
2022-06-12 22:17 ` Dmitry Gutov
2022-06-13 15:00   ` Eason Huang [this message]
2022-06-14  1:03     ` Dmitry Gutov
2022-06-14 11:22       ` Eason Huang
2022-06-14 12:47         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_97E3B59DCD0CB9C497AE1217A4CB8D38F007@qq.com \
    --to=aqua0210@foxmail.com \
    --cc=55396@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).