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: Sun, 12 Nov 2023 11:07:38 -0800

On 11/11/2023 10:03 PM, Eli Zaretskii wrote:
Date: Sun, 12 Nov 2023 00:00:13 +0200
Cc: 67062@debbugs.gnu.org
From: Dmitry Gutov <dmitry@gutov.dev>

Our general approach is to prefer global options and dynamic dispatch on
backends, resorting to using per-backend options when it's much easier
to do.

Which I think is the case here.  What other VC backend has such long
revision strings?  I couldn't think of any.

Game of Trees[1] is one, though you could argue that that's cheating because it uses the Git repository format. It does have a GNU ELPA package though, so the author would probably want to add a 'vc-got-short-revision' function. (Or something similar depending on what this patch looks like if/when it merges.) Looking at some GoT repositories, they *do* still use the long SHA-1 hashes for revision identifiers.

In fact, there are at least a couple Git-compatible VCSes now. Facebook wrote one called "Sapling", though I haven't used it. Based on some screenshots at least, it looks like Sapling also uses SHA-1 hashes for revision IDs.

In any case, we don't necessarily need to provide a default implementation for the 'short-revision' function. What about something like this? I'm not sure it's better, but it does let us avoid defining a no-op implementation for the "default backend".

[1] https://gameoftrees.org/index.html

[2] https://github.com/facebook/sapling

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]