|
From: | Dmitry Gutov |
Subject: | bug#67062: 30.0.50; [PATCH] Abbreviate the revision in 'vc-annotate' (for Git) |
Date: | Fri, 15 Dec 2023 02:15:16 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 15/12/2023 02:06, Jim Porter wrote:
b) 'vc-working-revision' caches the revision, so it's not as easy as just setting a variable that controls the behavior: you'd need some special logic for invalidating the cache, or perhaps ignoring the cache when 'vc-use-short-revisions' is non-nil or something.
That makes sense indeed. But you could add a new function vc-short-revision and a variable vc-use-show-revisions, where the latter would be obeyed by vc-git-working-revision only.
vc-short-revision could call (vc-call-backend backend 'working-revision file) directly (with vc-use-show-revisions bound to t), since it doesn't seem to really need caching, at least in the current usage. Or it could create its own cache.
While this patch does add a new backend action, it's purely optional and no other backend needs to be aware of it at all. I suppose I could hardcode the Git behavior in 'vc-short-revision', but that didn't seem to me to have any benefits over this version.
I agree that the new backend action 'short-revision' (unique to Git) is not a problem.
I'm just saying that 'vc-git-use-short-revisions' might be unnecessary.It's possible, I suppose, that some users might prefer long revisions instead of short ones (in the buffer name for vc-annotate), but we could wait for such requests to show up first.
[Prev in Thread] | Current Thread | [Next in Thread] |