GNU bug report logs -
#21383
Static revisions in vc-working-revision
Previous Next
Reported by: Jonathan H <pythonnut <at> gmail.com>
Date: Mon, 31 Aug 2015 00:47:01 UTC
Severity: wishlist
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #49 received at 21383-done <at> debbugs.gnu.org (full text, mbox):
On 09/03/2015 01:44 AM, Jonathan H wrote:
> I'm using (vc-working-revision buffer-file-name (vc-responsible-backend
> buffer-file-name)) to determine the current working revision.
>
> As far as I can tell, vc-working-revision will cache the current working
> revision in a file property, but it doesn't know when to invalidate the
> cache, so the results can be stale.
Yes, invalidation of those properties could use some improvement. But if
you're just worried about up-to-date results returned to your functions,
you could remove the property before calling `vc-working-revision'.
> In fact, in the specific case of
> git, you probably can't get any faster than a rev-parse anyway,
I wonder if that's true. Caching in a property is obviously fast, and
process calls are necessarily an order of magnitude slower (and slower
still on certain platforms).
Maybe you should write a patch and test it on Windows (or have someone
else do it), and see whether the mode-line updates don't become
perceptibly slower.
> I have a sneaking suspicion that git isn't the only backend where this
> can happen.
Probably. On the other hand, there are known backends where calling the
backend program *is* slow. Such as Bazaar or (most likely) CVS.
This bug report was last modified 9 years and 263 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.