Re: git-blame.el: format of date strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:
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@xxxxxxxxx>
---
  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"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]