Merge branch 'log-grep'

This commit is contained in:
Phil Jackson 2010-03-26 16:33:50 +00:00
commit c23b334d29

View file

@ -3109,7 +3109,8 @@ Prefix arg means justify as well."
,style ,style
,@(if magit-have-decorate (list "--decorate=full")) ,@(if magit-have-decorate (list "--decorate=full"))
,@(if magit-have-graph (list "--graph")) ,@(if magit-have-graph (list "--graph"))
,args "--")))) ,@args
"--"))))
(defun magit-log (&optional arg) (defun magit-log (&optional arg)
(interactive "P") (interactive "P")
@ -3117,18 +3118,28 @@ Prefix arg means justify as well."
(magit-read-rev-range "Log" "HEAD") (magit-read-rev-range "Log" "HEAD")
"HEAD")) "HEAD"))
(topdir (magit-get-top-dir default-directory)) (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*") (switch-to-buffer "*magit-log*")
(magit-mode-init topdir 'log #'magit-refresh-log-buffer range (magit-mode-init topdir 'log #'magit-refresh-log-buffer range
"--pretty=oneline" args))) "--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) (defun magit-log-long (&optional arg)
(interactive "P") (interactive "P")
(let* ((range (if arg (let* ((range (if arg
(magit-read-rev-range "Long log" "HEAD") (magit-read-rev-range "Long log" "HEAD")
"HEAD")) "HEAD"))
(topdir (magit-get-top-dir default-directory)) (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*") (switch-to-buffer "*magit-log*")
(magit-mode-init topdir 'log #'magit-refresh-log-buffer range (magit-mode-init topdir 'log #'magit-refresh-log-buffer range
"--stat" args))) "--stat" args)))