From 76af73d23efa015ba2846510816df0183b7f4f54 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Thu, 19 Jan 2017 22:51:18 -0500 Subject: magit: Shorten hashes in locked revision buffers --- init.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/init.el b/init.el index e859662..7f05364 100644 --- a/init.el +++ b/init.el @@ -988,6 +988,20 @@ (km/magit-mode-kill-hidden 'magit-diff-mode)) '((name . "magit-diff-kill-previous"))) + (advice-add + 'magit-generate-buffer-name-default-function + :around + (lambda (fn mode &optional value) + (let ((rev (and (listp value) (car value)))) + (when (and rev (stringp rev) + (string-match-p (rx string-start + (= 40 (any "a-z" "0-9")) + string-end) + rev)) + (setcar value (magit-rev-abbrev rev)))) + (funcall fn mode value)) + '((name . "magit-buffer-name-shorten-hash"))) + (advice-add 'magit-git-fetch :around (lambda (fn &rest args) -- cgit v1.2.3