Subject: Re: bug#58525: 28.1: `vc-dir' (key sequence: C-x v d) fails when used with a CVS repository

From: Dmitry Gutov <[email-masked]>
Date: Tue, 18 Oct 2022 02:10:01 +0300

On 17.10.2022 20:43, Mark Harig via Bug reports for GNU Emacs, the Swiss 
army knife of text editors wrote:
> So, after finding the CVS backend, the `mapcar' expression, above,
> continues and checks for a Git backend, which it finds in the directory
> that contains tmp3/project1, namely, ~, the home directory.  Because
> it found ~/.git/, it sets the variable `dirs' to an erroneous value and
> later logic fails because of this.
> 
> What is the solution to this problem?  What should the VC
> functions (not just `vc-dir') do when they find more than one VC
> backend indicator in the directory tree?  Should it issue an
> error indicating more than one VC backend detected, (since files
> cannot be under the control of multiple VC backends)?  Or, should
> it stop after the "most local" VC backend is found and attempt to
> use that?

It tries to use the most specific one, by using the sorting logic at the 
end of vc-responsible-backend. That was added in 
https://debbugs.gnu.org/42966, which should have made it into Emacs 28.1.

I'm not sure why your CVS value in that list is t and not a string: that 
should have been fixed in Emacs 28.1 as well, in revision 
bc636515884530f0cab6f.

There was a further fix, though (regarding expanded vs abbreviated file 
names) which is only available on master (bug#57777). But I'm not sure 
if that comes into play here.

Anyway, are you really using Emacs 28.1? If not, try that, if yes: could 
you try building Emacs from master? And seeing whether it fixes your 
problem.