Subject: Re: bug#43464: 28.0.50; vc: Error calling vc-revert for repo root
From: Sean Whitton <[email-masked]>
To: Dmitry Gutov <[email-masked]>
Cc: [email-masked], Andrii Kolomoiets <[email-masked]>
Date: Mon, 17 Feb 2025 15:42:13 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

On Tue 13 Oct 2020 at 02:59pm +03, Dmitry Gutov wrote:

> On 11.10.2020 23:28, Andrii Kolomoiets wrote:
>
>> Does those kind of changes should be applied to any function that uses
>> 'vc-call' and can be called on dirs?
>
> I think so. Since none of them should work on directories now, it should be
> accompanied with some doc changes as well.

I went through all uses of vc-call in emacs.git and found that the only
two which would make sense to apply to directories are vc-rename-file
and vc-revert-file.  I've added a FIXME to the former.

>>> Also, your patch makes vc-registered work on directories.
>> How is that?  'vc-registered' is still returns nil for directories.  The
>> changes affects only the side effect of it.
>
> Oh, now I finally understand what it's doing.
>
> You can probably see how it's not ideal control flow (call a function, see it
> return nil, and then rely on its undocumented side-effect).
>
> So if we can avoid doing that and still fix the bug, the alternative approach
> should be preferable.

I'm not sure what you meant here, because Andrii's patch still has the
problem of creating cache entries for directories that will never be
invalidated.  That's more significant than the control flow issue.

I've now installed a change to fix this bug based on Dmitry's approach.

-- 
Sean Whitton