Subject: bug#21383: closed (Re: bug#21383: Static revisions in vc-working-revision)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 01 Sep 2015 12:06:02 +0000

Your bug report

#21383: Static revisions in vc-working-revision

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21383: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21383
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21383: Static revisions in vc-working-revision
From: Dmitry Gutov <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked], Jonathan H <[email-masked]>
Date: Tue, 1 Sep 2015 15:05:27 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

On 09/01/2015 06:55 AM, Stefan Monnier wrote:

> VC was originally designed so as to separate the VC data from the
> buffers, so the `file' argument was absolutely indispensable (you
> can't/shouldn't rely on things like the current-buffer's default-directory).
>
> I think nowadays the design has been changed enough that indeed the
> `file' arg can be dispensed with.

I think just the current usage, everywhere, makes it okay. But if I were 
to inquire of the status of a file in a different repository, that would 
still fail. We don't don't seem to do that anywhere, though, and 
supporting that usage would require fixes in multiple places.

This patch doesn't change much in this regard: FILE wasn't used for its 
default-directory even before it.

> The rest looks OK to me,

Thanks, installed.

Subject: Static revisions in vc-working-revision
From: Jonathan H <[email-masked]>
To: [email-masked]
Date: Sun, 30 Aug 2015 17:45:25 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello all!

I've attached a basic patch that adds an option to vc-working-revision. The
option is named *concrete* and if non-nil, it forces vc-working-revision to
return a revision name that will not go stale after new revisions are made.

This is useful for, e.g. git, where vc-working-revision will just return
the branch name, which only refers to the current commit for as long as
it's the head of the branch.

I'm using this in diff-hl #33 <https://github.com/dgutov/diff-hl/issues/33>to
determine when to refresh the current VC highlighting.

I've supplied an implementation for Git, and no-op implementations for all
the other backends. For most systems (i.e. all the other VCS systems I
know), the value of *concrete *does not matter. If you know a backend that
would benefit from a real implementation, please let me know.

Also, this is my first patch, so I'm not entirely sure I've got all my
ducks in a row. Any comments on that would be great too.

Thanks,
Jonathan