git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "David Kågedal" <davidk@lysator.liu.se>
Cc: Jakub Narebski <jnareb@gmail.com>,
	Xavier Maillard <zedek@gnu.org>,
	Alexandre Julliard <julliard@winehq.org>,
	Martin Nordholts <enselic@gmail.com>,
	Kevin Ryde <user42@zip.com.au>,
	git@vger.kernel.org, Andreas Schwab <schwab@linux-m68k.org>,
	Sergei Organov <osv@javad.com>
Subject: git-blame.el: format of date strings
Date: Fri, 11 Feb 2011 00:42:47 -0600	[thread overview]
Message-ID: <20110211064247.GA26091@elie> (raw)
In-Reply-To: <20110211022928.GA24775@elie>

Jonathan Nieder wrote:

>  - The time format (%c) is rather verbose.  I think I prefer %D
>    (so maybe this is a potential tweakable?).

Here's what that might look like.  Sadly, format-time-string does not
seem to have an equivalent to git log's %ar format.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 contrib/emacs/git-blame.el |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el
index 9f60a6f..a43981e 100644
--- a/contrib/emacs/git-blame.el
+++ b/contrib/emacs/git-blame.el
@@ -121,6 +121,12 @@ mode. See `git-blame-format' for more information.
 `git-blame' mode. See `git-blame-format' for more information."
   :group 'git-blame)
 
+(defcustom git-blame-date-format
+  "%c"
+  "The format of dates specified with %t or %T passed to `git-blame-format'.
+See `format-time-string' for more information."
+  :group 'git-blame)
+
 (defun git-blame-format (info format)
   "Use format-spec to format the blame info in INFO with the following keys:
 
@@ -146,10 +152,10 @@ mode. See `git-blame-format' for more information.
                    (?H . ,(car info))
                    (?a . ,(git-blame-get-info info 'author))
                    (?A . ,(git-blame-get-info info 'author-mail))
-                   (?t . ,(format-time-string "%c" author-time))
+                   (?t . ,(format-time-string git-blame-date-format author-time))
                    (?c . ,(git-blame-get-info info 'committer))
                    (?C . ,(git-blame-get-info info 'committer-mail))
-                   (?T . ,(format-time-string "%c" committer-time))
+                   (?T . ,(format-time-string git-blame-date-format committer-time))
                    (?s . ,(git-blame-get-info info 'summary))))))
 
 (defun git-blame-color-scale (&rest elements)
-- 
1.7.4

  reply	other threads:[~2011-02-11  6:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-04 16:21 git-blame.el: what is format-spec? Sergei Organov
2009-12-04 16:38 ` Andreas Schwab
2009-12-04 16:59   ` Sergei Organov
2009-12-04 17:36     ` David Kågedal
2009-12-04 20:54       ` Sergei Organov
2009-12-06 18:43         ` David Kågedal
2009-12-07  8:36           ` Sergei Organov
2009-12-07  9:05             ` David Kågedal
2010-05-14 13:13           ` Alex Unleashed
2010-05-25 13:44             ` [PATCH] git-blame.el: Add (require 'format-spec) David Kågedal
2010-10-29  3:38               ` [PATCH resend] " Jonathan Nieder
2011-02-04  1:43           ` git-blame.el: does not show one-line summary in echo area Jonathan Nieder
2011-02-04  9:53             ` David Kågedal
2011-02-04 10:03               ` Jakub Narebski
2011-02-04 10:15                 ` David Kågedal
2011-02-04 12:26                   ` David Kågedal
2011-02-11  2:29                     ` Jonathan Nieder
2011-02-11  6:42                       ` Jonathan Nieder [this message]
2011-02-11  7:56                         ` git-blame.el: format of date strings Martin Nordholts
2012-06-10  8:24                       ` [PATCH/RFC] git-blame.el: truncate author to avoid jagged left edge of code Jonathan Nieder
2013-01-29 20:17                         ` David Kågedal
2011-02-04 21:49                   ` git-blame.el: does not show one-line summary in echo area Kevin Ryde
2009-12-04 17:42     ` git-blame.el: what is format-spec? Andreas Schwab
2009-12-04 18:18       ` Matthieu Moy

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=20110211064247.GA26091@elie \
    --to=jrnieder@gmail.com \
    --cc=davidk@lysator.liu.se \
    --cc=enselic@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=julliard@winehq.org \
    --cc=osv@javad.com \
    --cc=schwab@linux-m68k.org \
    --cc=user42@zip.com.au \
    --cc=zedek@gnu.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).