From 29395e0d4639c2a5745daaf0d1aa5cabb0627680 Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Fri, 26 Mar 2010 16:31:40 +0000 Subject: [PATCH 1/2] `magit-refresh-log-buffer' can now take more than one (git commandline) argument. --- magit.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/magit.el b/magit.el index af15e0f9..29ff78c7 100644 --- a/magit.el +++ b/magit.el @@ -3091,7 +3091,8 @@ Prefix arg means justify as well." ,style ,@(if magit-have-decorate (list "--decorate=full")) ,@(if magit-have-graph (list "--graph")) - ,args "--")))) + ,@args + "--")))) (defun magit-log (&optional arg) (interactive "P") @@ -3099,7 +3100,7 @@ Prefix arg means justify as well." (magit-read-rev-range "Log" "HEAD") "HEAD")) (topdir (magit-get-top-dir default-directory)) - (args (magit-rev-range-to-git range))) + (args (list (magit-rev-range-to-git range)))) (switch-to-buffer "*magit-log*") (magit-mode-init topdir 'log #'magit-refresh-log-buffer range "--pretty=oneline" args))) @@ -3110,7 +3111,7 @@ Prefix arg means justify as well." (magit-read-rev-range "Long log" "HEAD") "HEAD")) (topdir (magit-get-top-dir default-directory)) - (args (magit-rev-range-to-git range))) + (args (list (magit-rev-range-to-git range)))) (switch-to-buffer "*magit-log*") (magit-mode-init topdir 'log #'magit-refresh-log-buffer range "--stat" args))) From c7c02c2f204e88ed5b08ff5ca6718e33207ebcaf Mon Sep 17 00:00:00 2001 From: Phil Jackson Date: Fri, 26 Mar 2010 16:33:32 +0000 Subject: [PATCH 2/2] Added the command `magit-log-grep' (no keybinding). --- magit.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/magit.el b/magit.el index 29ff78c7..88dd8120 100644 --- a/magit.el +++ b/magit.el @@ -3105,6 +3105,16 @@ Prefix arg means justify as well." (magit-mode-init topdir 'log #'magit-refresh-log-buffer range "--pretty=oneline" args))) +(defun magit-log-grep (str) + "Search for " + (interactive "sGrep in commit log: ") + (let ((topdir (magit-get-top-dir default-directory))) + (switch-to-buffer "*magit-log-grep*") + (magit-mode-init topdir 'log #'magit-refresh-log-buffer "HEAD" + "--pretty=oneline" + (list "-E" + (format "--grep=%s" (shell-quote-argument str)))))) + (defun magit-log-long (&optional arg) (interactive "P") (let* ((range (if arg