When I'm reviewing a patch series in magit I want to be able to look in detail at each patch in a tree. However there doesn't seem to be an easy way to navigate to the next/previous commit from inside magit-revision-mode. I end up having to switch back to log mode to select the next commit which is inefficient.

Does magit-revision-mode have any context for where in the log view it was when it was called?

  • When one opens the buffer in magit-rev-mode using RET from a buffer in blame mode this does not help. Except if one can open the log buffer with the point at the blamed commit.
    – cognominal
    Commented Apr 8, 2019 at 16:52

2 Answers 2


That isn't supported yet but you can do it "the other way around". Instead of pressing RET to show and select the revision buffer, press SPC to show the revision buffer but stay in the log buffer.

When you move to another revision in the log buffer, the revision buffer is automatically updated. And you can press SPC again to scroll the revision buffer, while staying in the log buffer.

Of course some things are not possible when you stay in the log buffer, e.g. you cannot collapse any sections in the revision buffer from the log buffer. So yes, it would be nice to move to the next/previous revision while in the revision buffer. Please open a feature request for that.


With this piece of code, after press SPC in the log buffer, it display commit diff each time you move up or down. Another SPC to disable.

(defun magit-log-move-down-and-show-diff ()
  "Move to next line and show diff"

(defun magit-log-move-up-and-show-diff ()
  "Move to previous line and show diff"

(define-minor-mode magit-log-auto-diff-mode
  "In git log buffer, minor mode to update revision buffer each time up or down
key is pressed"
  :keymap (let ((map (make-sparse-keymap)))
            (define-key map (kbd "<down>") 'magit-log-move-down-and-show-diff)
            (define-key map (kbd "<up>") 'magit-log-move-up-and-show-diff)
  (if magit-log-auto-diff-mode

(with-eval-after-load "magit-log"
  (define-key magit-log-mode-map (kbd "SPC") 'magit-log-auto-diff-mode))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.