When editing a file managed by Git, vc-annotate
shows the output of git blame
. As Git usually does, revisions are identified by a short commit id.
The short commit id is abbreviated to be one character longer than in the output of every other command. This breaks workflows where I use the annotate buffer to navigate to a commit, copy the revision (which is an abbreviated commit id), and search this abbreviated commit id elsewhere (git log --oneline
, Magit control buffer, git rebase -i
commit list, …). I need to remove the last character from the commit id.
If I can't convince Git itself to use the same short commit length for git blame
as for other commands, how can I make vc-annotate
strip the last character of commit ids?
A quick look at the vc code doesn't reveal an obvious way to run a hook after a specific command for a specific version control system.
^1234567
instead of12345678
so that1234567
is unique and not just12345678
. The chances that this would be relevant in an interactive workflow, especially in this case where I'm looking at the whole history and so a single commit is the boundary commit, are extremely remote and not worth the aggravation of the extra characters.