Refactor git-timemachine-show-commit fix
As per https://gitlab.com/pidu/git-timemachine/issues/77
This commit is contained in:
parent
059030be49
commit
aee1c851fc
1 changed files with 4 additions and 10 deletions
|
@ -14,16 +14,10 @@
|
||||||
"Fix `git-timemachine-show-commit'."
|
"Fix `git-timemachine-show-commit'."
|
||||||
:override #'git-timemachine-show-commit
|
:override #'git-timemachine-show-commit
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((rev (car git-timemachine-revision)))
|
(if (fboundp 'magit-show-commit)
|
||||||
(if (fboundp 'magit-revision-mode)
|
(save-excursion
|
||||||
(with-temp-buffer
|
(magit-show-commit (car git-timemachine-revision)))
|
||||||
(save-excursion
|
(message "You need to install magit to show commit")))
|
||||||
(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"))))
|
|
||||||
|
|
||||||
;; 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue