1. On a system with a version of Git older than 2.7.0, navigate to a
git-controlled directory and invoke "emacs -Q".
2. With this as the default directory, invoke vc-dir. This fails
with the error "vc-do-command: Failed (status 129): git --no-pager
remote get-url origin ."
This is because the "get-url" subcommand of "git remote", used by
vc-git-repository-url, was added in 2.7.0 [1]. The attached patch
against master rev 1db7e8eba961e88181879213dd5374ad9e87ac76 uses "git
config" in a way that works in both old and new systems (tested with git
2.1.2 and git 2.35.3).
Of course, supporting 7+-year-old versions of git is probably not a
high priority, so I won't be too disappointed if this fix is rejected.
On the other hand, it's a small change, and having vc-dir fail on any
system, especially when using Git, puts a big damper on being able to
use Emacs to hack on things in older systems, so I think it's worth
having.