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 11:42:45 -0800

On 11/13/2023 6:19 AM, Eli Zaretskii wrote:
This solution is also fine by me.

Thanks.

Ok, having tried out a few different implementation options, how about something like this? This adds a new function, 'vc-short-revision', that calls 'vc-working-revision' for most backends, but first checks if 'vc-BACKEND-short-revision' exists; if so, it calls that instead. Then the Git backend defines this function to do the necessary legwork. Hopefully this strikes the right balance between not requiring any extra code for other backends (including the default "backend"), while also not hardcoding "(if (eq backend 'Git)" in a generic function.

In practice, this should work, though I should mention one caveat: when you pass a particular REV to 'vc-annotate', it will use that REV as-is in the buffer name. In my other patches, 'vc-annotate' would normalize the REV (so, for example, you could pass in the full 40-character Git SHA to 'vc-annotate' and the buffer name would only show the shortened form). I'm not sure this is a big deal though, since the Git revisions that you see on each line for 'vc-annotate' are the short revs by default; that means that when you call 'vc-annotate-revision-previous-to-line', it'll pass the *short* rev at that line to 'vc-annotate'.

Attachment: 0001-Abbreviate-the-VC-revision-in-vc-annotate-s-buffer-n.patch
Description: Text document


reply via email to

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