diff options
author | Kyle Meyer <kyle@kyleam.com> | 2017-01-19 22:51:18 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2017-01-19 22:51:18 -0500 |
commit | 76af73d23efa015ba2846510816df0183b7f4f54 (patch) | |
tree | d48907341c6d855d8d54852522257c419a36b2f8 | |
parent | bd96dbc0a377c8d97875985d820979077a4f46db (diff) | |
download | emacs.d-76af73d23efa015ba2846510816df0183b7f4f54.tar.gz |
magit: Shorten hashes in locked revision buffers
-rw-r--r-- | init.el | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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) |