summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2018-08-11 23:38:46 -0400
committerKyle Meyer <kyle@kyleam.com>2018-08-17 23:23:49 -0400
commitc92952fdcd94590b0a603dd358908cb7d276c991 (patch)
treee13073718ca58405f3c145aa95ced3e0e261bfe4
parent9b7ed6d62bd7269420e2acab8585bf73896df5a2 (diff)
downloademacs.d-c92952fdcd94590b0a603dd358908cb7d276c991.tar.gz
magit: Add custom magit-log-current variant
-rw-r--r--init.el2
-rw-r--r--lisp/km-magit.el6
2 files changed, 8 insertions, 0 deletions
diff --git a/init.el b/init.el
index 0ab72fc..d029c64 100644
--- a/init.el
+++ b/init.el
@@ -1177,6 +1177,8 @@
?p ?P)
(magit-define-popup-action 'magit-log-popup
+ ?l "Log current" #'km/magit-log-current)
+ (magit-define-popup-action 'magit-log-popup
?d "Log dwim" #'km/magit-log-dwim)
(magit-define-popup-action 'magit-log-popup
?y "Cherry dwim" #'km/magit-cherry-dwim)
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 19cae74..83b6b08 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -627,6 +627,12 @@ argument. Interactively, this can be accessed using the command
'git-commit-flyspell-verify)
(turn-on-flyspell))
+(defun km/magit-log-current (&optional args files)
+ "Like `magit-log-current', but if head is detached, use \"HEAD\"."
+ (interactive (magit-log-arguments))
+ (magit-log (list (or (magit-get-current-branch) "HEAD"))
+ args files))
+
(defun km/magit-log-dwim (&optional args files)
(interactive (magit-log-arguments))
(let ((range