* [PATCH] git-blame.el: Add `git-blame-show-full-message'
@ 2009-08-09 14:27 Martin Nordholts
0 siblings, 0 replies; only message in thread
From: Martin Nordholts @ 2009-08-09 14:27 UTC (permalink / raw)
To: git
Add an interactively callable function `git-blame-show-full-message'
that shows the full commit message with --pretty=full in the echo
area.
The purpose of the function is to allow a user of git-blame.el to
browse around in a file until an interesting commit oneliner is shown,
at which point the user can invoke `git-blame-show-full-message' to
get more verbose information.
Signed-off-by: Martin Nordholts <martinn@src.gnome.org>
---
contrib/emacs/git-blame.el | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el
index 4fa70c5..443ebce 100644
--- a/contrib/emacs/git-blame.el
+++ b/contrib/emacs/git-blame.el
@@ -40,7 +40,8 @@
;; turn it on while viewing a file, the editor buffer will be updated by
;; setting the background of individual lines to a color that reflects
;; which commit it comes from. And when you move around the buffer, a
-;; one-line summary will be shown in the echo area.
+;; one-line summary will be shown in the echo area. To get the complete
+;; commit message, invoke `git-blame-show-full-message'.
;;; Installation:
;;
@@ -340,7 +341,7 @@ See also function `git-blame-mode'."
(git-blame-random-pop git-blame-colors)
git-blame-ancient-color)))
(setq info (list hash src-line res-line num-lines
- (git-describe-commit hash)
+ (git-describe-commit hash git-blame-log-oneline-format)
(cons 'color color))))
(puthash hash info git-blame-cache))
(goto-line res-line)
@@ -375,11 +376,11 @@ See also function `git-blame-mode'."
(car info)
(error "No commit info"))))
-(defun git-describe-commit (hash)
+(defun git-describe-commit (hash pretty-format)
(with-temp-buffer
(call-process "git" nil t nil
"log" "-1"
- (concat "--pretty=" git-blame-log-oneline-format)
+ (concat "--pretty=" pretty-format)
hash)
(buffer-substring (point-min) (point-max))))
@@ -392,6 +393,11 @@ See also function `git-blame-mode'."
(message "%s" (nth 4 info))
(setq git-blame-last-identification info))))
+(defun git-blame-show-full-message ()
+ "Show full log message about current commit"
+ (interactive)
+ (message (git-describe-commit (git-blame-current-commit) "full")))
+
;; (defun git-blame-after-save ()
;; (when git-blame-mode
;; (git-blame-cleanup)
--
1.6.2.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-09 14:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-09 14:27 [PATCH] git-blame.el: Add `git-blame-show-full-message' Martin Nordholts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).