Subject: bug#53831: 29.0.50; vc-git-registered hangs when examining files in .git directory for submodule

From: Dmitry Gutov <[email-masked]>
Date: Mon, 21 Feb 2022 03:37:30 +0200

Hi!

On 07.02.2022 00:56, Robert Irelan wrote:
> - Eventually, we attempt a `call-process` with the command line
>    `git --no-pager ls-files -c -z -- .git/modules/.doom.d/COMMIT_EDITMSG`
>    with `default-directory` set to `~`. This command takes around 20
>    seconds to exit with an empty output and exit status 0. I believe at
>    this point the code may continue to loop, since it hangs for longer
>    than that until I hit `C-g` a bunch of times.

Any idea why it hangs? Is that because of the size of the repository, or 
something like that?

I've tried to recreate this problem, but even with large repos 'git 
--no-pager ls-files -c -z -- .git/modules/.doom.d/COMMIT_EDITMSG' 
returns pretty quickly.

Does it take 20 seconds when running from a terminal? What if you try 
that with different files inside '.git'?

 > I propose that `vc-git-registered` return nil if the path contains
`/.git/`, since the contents of `.git` are never part of the Git
repository.

This can work. Though I'd rather understand the problem better first.