summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-08-04 09:41:01 -0400
committerKyle Meyer <kyle@kyleam.com>2018-08-04 09:41:01 -0400
commit1e37aa08e8ddecf62960f339dcd3914e21775fee (patch)
tree8cb0a68c6a29fd273b71b53a2184158771ee7479 /lisp
parent91b83b657774e8cb5919e5654362bdad4249f1bf (diff)
downloademacs.d-1e37aa08e8ddecf62960f339dcd3914e21775fee.tar.gz
Add km/magit-log-occurrence command
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 4bad322..19cae74 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -654,6 +654,19 @@ argument. Interactively, this can be accessed using the command
(magit-log (list range) args files)
(call-interactively #'magit-log))))
+;;;###autoload
+(defun km/magit-log-occurrence (beg end)
+ "Run `git log -S<content (BEG..END)> HEAD'."
+ (interactive "r")
+ (magit-mode-setup-internal
+ #'magit-log-mode
+ (list (list "HEAD")
+ (cons (format "-S%s" (buffer-substring-no-properties beg end))
+ (cl-delete "-S" (car (magit-log-arguments))
+ :test 'string-prefix-p))
+ nil))
+ (magit-log-goto-same-commit))
+
(defun km/magit-cherry-dwim ()
(interactive)
(-let [(head . upstream)