Re: git-blame.el: format of date strings
- From
Martin Nordholts <enselic@gmail.com>
- Date
- Feb 11, 2011, 07:56 UTC
- Message-ID
- <4D54EB94.9010008@gmail.com>
- In-Reply-To
- <20110211064247.GA26091@elie>
Please remove me from CC in the next reply, thanks
I don't use git-blame.el any longer btw, I find this approach works better (adjust for your needs):
(defun programming-project-git-gui-blame ()
(interactive)
(shell-command (concat "cd "
(programming-project-get-current-source-root)
" && "
"git gui blame --line="
(int-to-string (line-number-at-pos nil))
" "
(buffer-file-name)
"&" )))/ Martin
On 02/11/2011 07:42 AM, Jonathan Nieder wrote:
Show 43 quoted lines
> 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)
-- My GIMP Blog: http://www.chromecode.com/ "Nightly GIMP, GEGL, babl tarball builds"