Subject: Re: bug#20637: incompatible, undocumented change to vc-working-revision

From: Dmitry Gutov <[email-masked]>
Date: Thu, 14 Apr 2016 17:20:41 +0300

On 04/14/2016 10:21 AM, Michael Albinus wrote:

> I haven't thought too much about performance. But you are right, we
> shouldn't add serious performance penalties to the code. And improving
> performance for the 25.1 release is much too late.

It's hard for me to judge how serious those are, really (I only have a 
fast laptop with GNU/Linux these days), but being wary of extra process 
calls seems prudent. Ideally, we'd reduce their number, not increase it.

> So we might revert the patch for vc-state and vc-working-revision indeed
> for the emacs-25 branch, going back to using vc-backend.

Thanks, I agree.

> In the master branch we might apply my proposed patch using
> vc-registered or something similar, and start to improve performance.

Improve how? Would you like to comment on the last paragraph of my 
previous email in this subthread?

I don't really see a point in returning `unregistered' from `vc-state'. 
When would the caller treat it differently from nil? And returning nil 
seems like an easier choice, implementation-wise, and well as a more 
conservative one from the backward compatibility perspective.

The `dir-status-files' backend command would continue including the 
`unregistered' entries (we could make it skip the up-to-date ones, 
though, in the interest of improving performance).

> In
> parallel, we shall start to write a VCS section for the elisp manual,
> describing vc-* functionality in more detail. We could start with
> vc-backend and vc-responsible-backend and their intended use. I'm
> missing such documentation for years.

I'd rather put the missing information into the docstrings, really. It 
seems unlikely that we're missing more than a few sentences in these two 
functions' descriptions, and we could also rephrase the existing ones.

But if you'd be more comfortable with having that information in the 
manual as well, don't let me stop you.

> I'll come back later today with the patch for emacs-25, if you agree.

In any case, I definitely agree with reverting vc-state and 
vc-working-revision to use vc-backend in Emacs 25.1.