Reflog commands a bit more like the log commands now.

This commit is contained in:
Phil Jackson 2010-11-01 14:28:52 +00:00
parent 96f9a1e405
commit 80ee094c9c
2 changed files with 16 additions and 14 deletions

View file

@ -22,10 +22,10 @@
(actions
("l" "Short" magit-display-log)
("L" "Long" magit-log-long)
("h" "Reflog" magit-reflog)
("rl" "Ranged short" magit-display-log-ranged)
("rL" "Ranged long" magit-log-long-ranged)
("h" "Reflog" magit-reflog)
("H" "Reflog on head" magit-reflog-head))
("rh" "Ranged reflog" magit-reflog-ranged))
(switches
("-m" "Only merge commits" "--merges")
("-f" "First parent" "--first-parent")

View file

@ -3854,19 +3854,21 @@ This is only non-nil in reflog buffers.")
:lighter ()
:keymap magit-reflog-mode-map)
(magit-define-command reflog (head)
(interactive (list (magit-read-rev "Reflog of" (or (magit-guess-branch) "HEAD"))))
(if head
(magit-define-command reflog (&optional ask-for-range)
(interactive)
(let ((at (or (if ask-for-range
(magit-read-rev "Reflog of" (or (magit-guess-branch) "HEAD")))
"HEAD")))
(let* ((topdir (magit-get-top-dir default-directory))
(args (magit-rev-to-git head)))
(args (magit-rev-to-git at)))
(switch-to-buffer "*magit-reflog*")
(magit-mode-init topdir 'reflog
#'magit-refresh-reflog-buffer head args)
(magit-reflog-mode t))))
#'magit-refresh-reflog-buffer at args)
(magit-reflog-mode t)))))
(magit-define-command reflog-head ()
(magit-define-command reflog-ranged ()
(interactive)
(magit-reflog "HEAD"))
(magit-reflog t))
;;; Diffing