bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67062: 30.0.50; [PATCH] Abbreviate the revision in 'vc-annotate' (fo


From: Jim Porter
Subject: bug#67062: 30.0.50; [PATCH] Abbreviate the revision in 'vc-annotate' (for Git)
Date: Thu, 14 Dec 2023 16:06:03 -0800

On 12/14/2023 1:58 PM, Dmitry Gutov wrote:
Do we need this option? I'm probably missing something, but IIUC a new variable to control the behavior was suggested as an alternative to using a new backend action. But here we add a new backend action anyway.

I had originally tried to do this purely with adding some variables and then using the existing backend functions. However, that would have resulted in 'vc-working-revision' returning either the full Git SHA or the short form depending on those options.

I didn't think that would be a safe idea, since a) other callers of 'vc-working-revision' might not be prepared to handle short Git SHAs, and 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. All of those issues scared me enough that I wanted to avoid altering the behavior of 'vc-working-revision' in any way.

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]