summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el14
1 files changed, 14 insertions, 0 deletions
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)