From: Martin Nordholts <enselic@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] git-blame.el: Add `git-blame-show-full-message'
Date: Sun, 09 Aug 2009 16:27:36 +0200 [thread overview]
Message-ID: <1249828056.11623.5.camel@localhost.localdomain> (raw)
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
reply other threads:[~2009-08-09 14:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1249828056.11623.5.camel@localhost.localdomain \
--to=enselic@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).