GNU bug report logs -
#43464
28.0.50; vc: Error calling vc-revert for repo root
Previous Next
Reported by: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Date: Thu, 17 Sep 2020 07:30:02 UTC
Severity: normal
Tags: confirmed
Merged with 37310
Found in versions 27.0.50, 28.0.50
Done: Sean Whitton <spwhitton <at> spwhitton.name>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 17 Feb 2025 15:42:13 +0800
with message-id <877c5pkofe.fsf <at> melete.silentflame.com>
and subject line Re: bug#43464: 28.0.50; vc: Error calling vc-revert for repo root
has caused the debbugs.gnu.org bug report #43464,
regarding 27.0.50; vc-revert: No such file or directory vc-nil
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
43464: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43464
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Steps to reproduce:
1. mkdir gittest && cd gittest
2. git init
3. echo "foo" > bar.txt
4. git add bar.txt
5. git commit -m "bar.txt added"
6. echo "baz" >> bar.txt
7. emacs -Q
8. C-x v d <RET> -- to open vc-dir for gittest directory
9. C-x v u
10. yes <RET> -- to confirm revert
Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "vc-nil")
require(vc-nil)
vc-find-backend-function(nil make-version-backups-p)
vc-call-backend(nil make-version-backups-p "/Users/mad/gittest/")
vc-version-backup-file("/Users/mad/gittest/")
vc-revert-file("/Users/mad/gittest/")
vc-revert()
funcall-interactively(vc-revert)
call-interactively(vc-revert nil nil)
command-execute(vc-revert)
Changing 'git' to 'hg' in the steps to reproduce above leads to the same
error.
Same issue in Emacs 26.3.
vc-backend returns nil for repository root dir. Maybe vc-registered
should return t for root repository directory and all subdirs.
Evaluating (vc-find-root "/Users/mad/gittest" ".git") returns
"~/gittest/" but (vc-registered "/Users/mad/gittest") returns nil.
[Message part 3 (message/rfc822, inline)]
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
This bug report was last modified 144 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.