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'.