From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eason Huang Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31017"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: 55396@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 13 17:01:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0lZ8-0007qj-RM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Jun 2022 17:01:19 +0200 Original-Received: from localhost ([::1]:54354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0lZ7-0006q4-B8 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Jun 2022 11:01:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0lYu-0006pH-Bj for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2022 11:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0lYs-0003gM-9s for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2022 11:01:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o0lYs-0000Pl-7d for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2022 11:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eason Huang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2022 15:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55396 X-GNU-PR-Package: emacs Original-Received: via spool by 55396-submit@debbugs.gnu.org id=B55396.1655132451854 (code B ref 55396); Mon, 13 Jun 2022 15:01:02 +0000 Original-Received: (at 55396) by debbugs.gnu.org; 13 Jun 2022 15:00:51 +0000 Original-Received: from localhost ([127.0.0.1]:60119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0lYg-0000DE-54 for submit@debbugs.gnu.org; Mon, 13 Jun 2022 11:00:50 -0400 Original-Received: from out203-205-221-202.mail.qq.com ([203.205.221.202]:57063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0lYY-0008M1-Vt for 55396@debbugs.gnu.org; Mon, 13 Jun 2022 11:00:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1655132427; bh=rVOOSR8mTx6O3724D3/a6ozSIua1z8U7KHlsqlBedL4=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=phxIebUwamEsnif4aMPKgXirv/ne4qFGff3ssjWYKCZ5/vW2nSDIA0U0Z1FXb8Q// or4S3rOJ1zX8AkERcuwUkydyHFR+8JhMDhxZ+uaKaHM/4YN+2/OqCPfToEaYH3qQOO 3wwu1bqGL5jEcqaO1+Fr2WxRS7tSd65rl+Bltrns= Original-Received: from MacBook ([114.82.35.172]) by newxmesmtplogicsvrszb6.qq.com (NewEsmtp) with SMTP id 1A16295; Mon, 13 Jun 2022 23:00:26 +0800 X-QQ-mid: xmsmtpt1655132426tk5o5mg8u X-QQ-XMAILINFO: NkD3iGBRs6TjZbrH801BoCLyk9PPN8FbEytEBCk3wwZO8l8H+L3qoShIeIYyAW ovM9n5RNxKHOWAHJjgpKDMvgn5zFxXjrju2ASa7aiNeFT7kxUPtgtYE5ehLPWZCoktJL7hWQaQa9 9LoMt+eFI4697WifVG/B7tOTGZ8RnZRLackS780RyvndO5c9r6SjlicKW5rmRD8KkQvg7Shfgw8l WNZWRyyVAedTTj5a+lWofR/7mYt6VCdYwICUOwzpTFt322X23grqhhmtK4kA60mrKfPgW76TSWzJ T+NvM9Z21TzDCm2ft9rUc5twhqyD6DWqvIC/BbjEV2qwCJa9nkfEukrEv2PKBnyMrNl1etQ+XZkD a3sQGf2caoGtFlIy34y/lN4PWsJ8Khu8ysHEkEVvTi7knDQD5lGyb7oyBDc2nIIdPNN0VYC6P7qf HC6WeYwerNcQop5xKYhmtqJiz2XG1ly/UHb45GOGyjn1JOqcYyMkzZnjnUV0r3f1h9ptlzYBIKws KHmXs6vj6RPZSFrUupDEgjGve2r1VgCXObMUzuci0XvKF2pEQ94DS/8GllfBiBQVNZvQr6HmyPkl uiJYVOH72JsI2cSapuHDtE2qWhsG6ki4DHO85yAQAR4us7FVyrp95rYcSbZqXyx0x3vAwzDp58e5 8LZVZiqD2rv17O+HKh9OgSvWifgRL73zBkjtF1GZN2Yt8wnaMUmu6qd4JFCRSJHOdzBwpqOV05c5 zyj0y8szAOL0zhpbzHTUlfJtjN6Z6AJ2TApykcbma493GVv1mKdQCgfJ5AfACGW6xZ+C0bxRWfxG suikovCiVzDxu1ELcnyWVI4UKhZGwXOQFmCdZSCb In-Reply-To: (Dmitry Gutov's message of "Mon, 13 Jun 2022 01:17:28 +0300") X-OQ-MSGID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:234415 Archived-At: Dmitry Gutov 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-s= tandard") >> project--vc-list-files("/Users/eason/.emacs.d/lib/aggressive-indent" = Git nil) >> #f(compiled-function (module) #)("lib/agg= ressive-indent") >> project--vc-list-files("/Users/eason/.emacs.d/." Git nil) >> #f(compiled-function (module) #)(".") >> project--vc-list-files("/Users/eason/.emacs.d/." Git nil) >> #f(compiled-function (module) #)(".") >> project--vc-list-files("/Users/eason/.emacs.d/." Git nil) >> #f(compiled-function (module) #)(".") >> 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/verti= co 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 =3D lib/vertico url =3D git@github.com:minad/vertico.git load-path =3D . load-path =3D 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: ``` =E2=9E=9C 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 ``` ``` =E2=9E=9C 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 =3D .` 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? --=20 Eason Huang