commit f808ba4f5b2cd918dbceecf59cf3096c858132f4 (HEAD, refs/heads/master)
Author: Leo <[email protected]>
Date: Thu Feb 24 20:52:53 2011 +0800
Fix broken long log command (issue 17)
https://github.com/philjackson/magit/issues#issue/17
---
magit.el | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
Modified magit.el
diff --git a/magit.el b/magit.el
index 903cd379..8e60d9af 100644
--- a/magit.el
+++ b/magit.el
@@ -3875,14 +3875,14 @@ (defun magit-log-show-more-entries (&optional arg)
(magit-refresh))
-(defun magit-refresh-log-buffer (range style args)
+(defun magit-refresh-log-buffer (range style args &optional washer)
(magit-configure-have-graph)
(magit-configure-have-decorate)
(setq magit-current-range range)
(magit-create-log-buffer-sections
(apply #'magit-git-section nil
(magit-rev-range-describe range "Commits")
- 'magit-wash-log
+ (or washer 'magit-wash-log)
`("log"
,(format "--max-count=%s" magit-log-cutoff-length)
,style
@@ -3927,6 +3927,19 @@ (magit-define-command log-long-ranged ()
(interactive)
(magit-log-long t))
+(defun magit-wash-long-log ()
+ (let ((re "^\\* commit \\([0-9a-fA-F]\\{40\\}\\)"))
+ (while (looking-at re)
+ (add-text-properties (match-beginning 1) (match-end 1)
+ '(face magit-log-sha1))
+ (let ((sha1 (match-string 1)))
+ (magit-with-section sha1 'commit
+ (magit-set-section-info sha1)
+ (forward-line 1)
+ (when (search-forward-regexp re nil 'move)
+ ;; make sure we are looking-at next commit beginning
+ (forward-line 0)))))))
+
(magit-define-command log-long (&optional ranged)
(interactive)
(let* ((range (if ranged
@@ -3937,7 +3950,7 @@ (magit-define-command log-long (&optional ranged)
magit-custom-options)))
(switch-to-buffer magit-log-buffer-name)
(magit-mode-init topdir 'log #'magit-refresh-log-buffer range
- "--stat" args)
+ "--stat" args #'magit-wash-long-log)
(magit-log-mode t)))
;;; Reflog