Subject: bug#21383: Static revisions in vc-working-revision

From: Stefan Monnier <[email-masked]>
Date: Thu, 03 Sep 2015 22:20:56 -0400

> That might be viable. But the commands that don't use FILE currently only
> need the root, so we could avoid passing the argument in entirely.

IIUC those operations are things like `working-revision', which should
return values which may depend on the FILE or not, depending on the
semantics of the backend.

So I don't think we can drop the FILE argument, but we can make it
clear that it's OK to ignore it and use default-directory instead.

That's why I'm suggesting to pass FILE as a relative file-name.
It is slightly delicate, tho, since the vc-root for default-directory
may actually be different from the vc-root for (expand-file-name
<relativename>).

> That is true. But could we abandon the current design for all backends? Some
> of the older ones still don't have vc-root implemented (because it's
> impossible for some of them?), and until it is, vc-state and friends won't
> know what to set default-directory to.

I don't think we should impose a constraint that default-directory is
vc-root.  So, backends like Git may still have to find the vc-root
from the default-directory (tho in many cases, the underlying executable
will do that for us).

        Stefan