With the cursor on the first commit in the *magit-log* buffer,
pressing p will cause an error. The cause seems to be the faulty
assumption in magit-goto-previous-section that every section in a log
buffer has a commit to display. The top section does not.
Attached is a patch to check whether the previous section is the top
section before attempting to show its commit. I think this is the
right thing, although perhaps the check should be for whether the
section has a commit and not whether it is the top section.
A potential issue is that the new behaviour leaves the first commit
visible although point is not on the associated line in the log
buffer. Not sure if that's worth bothering with.
diff -c /usr/local/share/emacs/site-lisp/magit.el /tmp/buffer-
content-3259eyj
*** /usr/local/share/emacs/site-lisp/magit.el 2010-07-02
00:38:04.000000000 +0800
--- /tmp/buffer-content-3259eyj 2010-07-06 04:12:14.000000000 +0800
***************
*** 919,925 ****
(let ((prev (magit-prev-section (magit-current-section))))
(if prev
(progn
! (if (memq magit-submode '(log reflog))
(magit-show-commit (or prev section)))
(goto-char (magit-section-beginning prev)))
(message "No previous section"))))
--- 919,926 ----
(let ((prev (magit-prev-section (magit-current-section))))
(if prev
(progn
! (if (and (memq magit-submode '(log reflog))
! (not (eq prev magit-top-section)))
(magit-show-commit (or prev section)))
(goto-char (magit-section-beginning prev)))
(message "No previous section"))))
Diff finished. Tue Jul 6 04:12:14 2010