GNU bug report logs -
#11757
24.1.50; vc-git calls `process-file' too many times
Previous Next
Reported by: Dmitry Gutov <dgutov <at> yandex.ru>
Date: Thu, 21 Jun 2012 02:17:02 UTC
Severity: normal
Found in version 24.1.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #53 received at 11757 <at> debbugs.gnu.org (full text, mbox):
On 01.07.2012 3:01, Stefan Monnier wrote:
>> This won't happen in following cases:
>> 1) We switch to revision when the opened file is the same.
>> 2) It doesn't exist there.
>> 3) We just delete it from disk from outside of Emacs.
>> So the file isn't changed, and you see no warning or update, even after you
>> write it to disk from Emacs again.
>
> While that is suboptimal, VC's state is often suboptimal like that.
> The only cases where VC's state is (or at least really should)
> up-to-date is:
> - when it was changed by an explicit VC action.
> - when we need to know the state in order to make an important decision.
> Updating the state in other circumstances is good, but not necessary.
> Improving VC so that the first case is more frequent would actually
> be preferable.
AFAIK, the second case with `vc-git-registered' only occurs in
`vc-next-action', where it can call `vc-register' if appropriate.
For that to happen, in `vc-deduce-fileset' either (vc-backend
buffer-file-name) should return nil, or (vc-state ...) - 'unregistered.
So, in all variations on the theme "file unchanged, but not in git index
anymore" this won't be true, neither with my original patch, nor with
the currently installed code.
Invalidating property 'git-registered in `vc-deduce-fileset' might fix
that, but having it know about Git backend is probably not good at all,
and AFAIK most other backends just detect all states with a single
process call, including 'unregistered (so they don't call their
-registered function from -state function).
-- Dmitry
This bug report was last modified 12 years and 363 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.