emacs/vc: add git-timemachine-show-commit fix
See https://gitlab.com/pidu/git-timemachine/issues/77
This commit is contained in:
parent
345d09d393
commit
ba71d95066
1 changed files with 15 additions and 0 deletions
|
@ -4,6 +4,21 @@
|
||||||
|
|
||||||
|
|
||||||
(after! git-timemachine
|
(after! git-timemachine
|
||||||
|
;; HACK Waiting for https://gitlab.com/pidu/git-timemachine/issues/77
|
||||||
|
(defun +vc*git-timemachine-show-commit ()
|
||||||
|
(interactive)
|
||||||
|
(let ((rev (car git-timemachine-revision)))
|
||||||
|
(if (fboundp 'magit-revision-mode)
|
||||||
|
(with-temp-buffer
|
||||||
|
(save-excursion
|
||||||
|
(magit-setup-buffer #'magit-revision-mode nil
|
||||||
|
(magit-buffer-revision rev)
|
||||||
|
(magit-buffer-range (format "%s^..%s" rev rev))
|
||||||
|
(magit-buffer-diff-args nil)
|
||||||
|
(magit-buffer-diff-files nil))))
|
||||||
|
(message "You need to install magit to show commit"))))
|
||||||
|
(advice-add #'git-timemachine-show-commit :override #'+vc*git-timemachine-show-commit)
|
||||||
|
|
||||||
;; Sometimes I forget `git-timemachine' is enabled in a buffer, so instead of
|
;; Sometimes I forget `git-timemachine' is enabled in a buffer, so instead of
|
||||||
;; showing revision details in the minibuffer, show them in
|
;; showing revision details in the minibuffer, show them in
|
||||||
;; `header-line-format', which has better visibility.
|
;; `header-line-format', which has better visibility.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue