[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 72a827a 373/399: counsel.el (counsel-git-log): Add additio
From: |
Oleh Krehel |
Subject: |
[elpa] master 72a827a 373/399: counsel.el (counsel-git-log): Add additional action. |
Date: |
Sat, 20 Jul 2019 14:58:02 -0400 (EDT) |
branch: master
commit 72a827a338412f3e73195b9934b2d593c7ca184b
Author: Brian Leung <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel.el (counsel-git-log): Add additional action.
counsel-git-log-show-commit-action uses Magit to visit the commit
corresponding to the currently selected log entry.
Fixes #2129
---
counsel.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/counsel.el b/counsel.el
index a2ccbf1..826462a 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1603,6 +1603,18 @@ done") "\n" t)))
"Add candidate X to kill ring."
(message "%S" (kill-new x)))
+(declare-function magit-show-commit "ext:magit-diff")
+
+(defun counsel-git-log-show-commit-action (log-entry)
+ "Visit the commit corresponding to LOG-ENTRY."
+ (require 'magit-diff)
+ (let ((commit (substring-no-properties log-entry 0 (string-match-p "\n"
log-entry))))
+ (magit-show-commit commit)))
+
+(ivy-set-actions
+ 'counsel-git-log
+ '(("v" counsel-git-log-show-commit-action "visit commit")))
+
;;** `counsel-git-change-worktree'
(defun counsel-git-change-worktree-action (git-root-dir tree)
"Find the corresponding file in the worktree located at tree.
- [elpa] master 520fd83 360/399: ivy.el (ivy-read): Simplify, (continued)
- [elpa] master 520fd83 360/399: ivy.el (ivy-read): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 2d22e05 363/399: doc/ivy.org: Add more info on TRAMP, Oleh Krehel, 2019/07/20
- [elpa] master 180d329 365/399: swiper.el (swiper--re-builder): Improve for char-fold-to-regexp, Oleh Krehel, 2019/07/20
- [elpa] master 4e9e310 368/399: ivy.el (ivy-read): Fix swiper-query-replace not working, Oleh Krehel, 2019/07/20
- [elpa] master a0b71a1 362/399: ivy.el (ivy--magic-tilde-directory): Cd remote "~" on "~", Oleh Krehel, 2019/07/20
- [elpa] master 3af75cf 364/399: swiper.el (swiper--positive-regexps): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 916e281 367/399: ivy.el (ivy-read): Fix bad refactor, Oleh Krehel, 2019/07/20
- [elpa] master 1ea4ebb 370/399: Fix minor typo, Oleh Krehel, 2019/07/20
- [elpa] master 2fa7cec 366/399: ivy-test.el (swiper--re-builder): Add test, Oleh Krehel, 2019/07/20
- [elpa] master 57e77a5 372/399: counsel.el (counsel-git-log-split-string-re): Change., Oleh Krehel, 2019/07/20
- [elpa] master 72a827a 373/399: counsel.el (counsel-git-log): Add additional action.,
Oleh Krehel <=
- [elpa] master 259cf07 374/399: Fix ivy-previous-line-or-history, Oleh Krehel, 2019/07/20
- [elpa] master d91f61d 378/399: counsel.el (counsel--split-string): Extract, Oleh Krehel, 2019/07/20
- [elpa] master e858b10 371/399: Add autoload for various commands, Oleh Krehel, 2019/07/20
- [elpa] master 75f4146 377/399: ivy.el (ivy-occur-revert-buffer): Stay on the same line, Oleh Krehel, 2019/07/20
- [elpa] master 3ec81dc 369/399: ivy-test.el (swiper--re-builder-char-fold): Split away, Oleh Krehel, 2019/07/20
- [elpa] master 98127be 375/399: ivy.el (ivy-format-functions-alist): Fix defcustom type, Oleh Krehel, 2019/07/20
- [elpa] master 1bb48ae 376/399: swiper.el: Add :group for faces, Oleh Krehel, 2019/07/20
- [elpa] master 3380b6f 382/399: swiper.el (swiper--avy-goto): Works for swiper-isearch, Oleh Krehel, 2019/07/20
- [elpa] master bd53ada 379/399: counsel.el (counsel-async-split-string-re-alist): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 0703a70 380/399: counsel.el (counsel-async-ignore-re-alist): Extract, Oleh Krehel, 2019/07/20