{"thread":{"id":"34325","subject":"[PATCH 2/4] git-blame.el: Make all line prefixes to have the same length","startedAt":"2013-07-02T17:34:33Z","lastAt":"2013-07-02T17:34:37Z","messageCount":5,"participants":["Michal Sojka"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"222380","messageId":"1372786477-13122-1-git-send-email-sojkam1@fel.cvut.cz","threadId":"34325","inReplyTo":null,"subject":"[PATCH 0/4] Emacs: git-blame.el fixes and enhancements","fromName":"Michal Sojka","fromEmail":"sojkam1@fel.cvut.cz","sentAt":"2013-07-02T17:34:33Z","receivedAt":"2013-07-02T17:34:33Z","isPatch":true,"sender":{"key":"sojkam1@fel.cvut.cz","avatar":"https://avatars.githubusercontent.com/u/140542?v=4"},"body":"Hi all,\n\nfollowing are a few fixes and enhancements to Emacs' git-blame-mode\n(contrib/emacs/git-blame.el).\n\nMichal Sojka (4):\n  git-blame.el: Fix buffer local declaration\n  git-blame.el: Make all line prefixes to have the same length\n  git-blame.el: Allow displaying author/commit times\n  git-blame.el: Change the default prefix format\n\n contrib/emacs/git-blame.el | 35 +++++++++++++++++++++++++++++++----\n 1 file changed, 31 insertions(+), 4 deletions(-)\n\n-- \n1.8.3.1\n"},{"id":"222381","messageId":"1372786477-13122-2-git-send-email-sojkam1@fel.cvut.cz","threadId":"34325","inReplyTo":"1372786477-13122-1-git-send-email-sojkam1@fel.cvut.cz","subject":"[PATCH 1/4] git-blame.el: Fix buffer local declaration","fromName":"Michal Sojka","fromEmail":"sojkam1@fel.cvut.cz","sentAt":"2013-07-02T17:34:34Z","receivedAt":"2013-07-02T17:34:34Z","isPatch":true,"sender":{"key":"sojkam1@fel.cvut.cz","avatar":"https://avatars.githubusercontent.com/u/140542?v=4"},"body":"git-blame-cache was declared buffer-local two times and\ngit-blame-idle-timer is global. The intended meaning was probably to make\ngit-blame-idle-timer buffer-local.\n\nSigned-off-by: Michal Sojka <sojkam1@fel.cvut.cz>\n---\n contrib/emacs/git-blame.el | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex e671f6c..18ce241 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -200,7 +200,7 @@ minor mode.\")\n \n (defvar git-blame-idle-timer nil\n   \"An idle timer that updates the blame\")\n-(make-variable-buffer-local 'git-blame-cache)\n+(make-variable-buffer-local 'git-blame-idle-timer)\n \n (defvar git-blame-update-queue nil\n   \"A queue of update requests\")\n-- \n1.8.3.1\n"},{"id":"222377","messageId":"1372786477-13122-3-git-send-email-sojkam1@fel.cvut.cz","threadId":"34325","inReplyTo":"1372786477-13122-1-git-send-email-sojkam1@fel.cvut.cz","subject":"[PATCH 2/4] git-blame.el: Make all line prefixes to have the same length","fromName":"Michal Sojka","fromEmail":"sojkam1@fel.cvut.cz","sentAt":"2013-07-02T17:34:35Z","receivedAt":"2013-07-02T17:34:35Z","isPatch":true,"sender":{"key":"sojkam1@fel.cvut.cz","avatar":"https://avatars.githubusercontent.com/u/140542?v=4"},"body":"Without this patch, the beginning of git-blame.el in emacs buffer looks\nlike this (note the Messige-ID line):\n\nb52ba1   <jnareb@gmail.com>:;; Authors:    David Kågedal <davidk@lysator.liu.se>\nb52ba1   <jnareb@gmail.com>:;; Created:    31 Jan 2007\n28389d <davidk@lysator.liu.se>:;; Message-ID: <87iren2vqx.fsf@morpheus.local>\nb52ba1   <jnareb@gmail.com>:;; License:    GPL\nb52ba1   <jnareb@gmail.com>:;; Keywords:   git, version control, release management\n\nWith this patch, all lines are aligned even if email addresses have\ndifferent length.\n\nb52ba1   <jnareb@gmail.com>:   ;; Authors:    David Kågedal <davidk@lysator.liu.se>\nb52ba1   <jnareb@gmail.com>:   ;; Created:    31 Jan 2007\n28389d <davidk@lysator.liu.se> ;; Message-ID: <87iren2vqx.fsf@morpheus.local>\nb52ba1   <jnareb@gmail.com>:   ;; License:    GPL\nb52ba1   <jnareb@gmail.com>:   ;; Keywords:   git, version control, release management\n\n\nSigned-off-by: Michal Sojka <sojkam1@fel.cvut.cz>\n---\n contrib/emacs/git-blame.el | 14 ++++++++++++--\n 1 file changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex 18ce241..573f408 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -116,6 +116,15 @@ mode. The format is passed to `format-spec' with the following format keys:\n \"\n   :group 'git-blame)\n \n+(defcustom git-blame-prefix-width\n+  \"%-30.30s \"\n+  \"The format for post-processing the prefix produced according\n+to `git-blame-prefix-format'. This format is passed to `format'\n+function. The default value ensures that all prefixes have the\n+same length, i.e. the it causes the prefix to be either truncated\n+or padded to 30 characters.\n+\"\n+  :group 'git-blame)\n (defcustom git-blame-mouseover-format\n   \"%h %a %A: %s\"\n   \"The format of the description shown when pointing at a line in\n@@ -410,8 +419,9 @@ See also function `git-blame-mode'.\"\n               (overlay-put ovl 'face (list :background\n                                            (cdr (assq 'color (cdr info))))))\n           (overlay-put ovl 'line-prefix\n-                       (propertize (format-spec git-blame-prefix-format spec)\n-                                   'face 'git-blame-prefix-face)))))))\n+                       (propertize (format git-blame-prefix-width\n+\t\t\t\t\t   (format-spec git-blame-prefix-format spec))\n+\t\t\t\t\t   'face 'git-blame-prefix-face)))))))\n \n (defun git-blame-add-info (info key value)\n   (nconc info (list (cons (intern key) value))))\n-- \n1.8.3.1\n"},{"id":"222379","messageId":"1372786477-13122-4-git-send-email-sojkam1@fel.cvut.cz","threadId":"34325","inReplyTo":"1372786477-13122-1-git-send-email-sojkam1@fel.cvut.cz","subject":"[PATCH 3/4] git-blame.el: Allow displaying author/commit times","fromName":"Michal Sojka","fromEmail":"sojkam1@fel.cvut.cz","sentAt":"2013-07-02T17:34:36Z","receivedAt":"2013-07-02T17:34:36Z","isPatch":true,"sender":{"key":"sojkam1@fel.cvut.cz","avatar":"https://avatars.githubusercontent.com/u/140542?v=4"},"body":"Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>\n---\n contrib/emacs/git-blame.el | 17 +++++++++++++++++\n 1 file changed, 17 insertions(+)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex 573f408..5c8933e 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -110,8 +110,10 @@ mode. The format is passed to `format-spec' with the following format keys:\n   %H - the full hash\n   %a - the author name\n   %A - the author email\n+  %t - the author time (see `git-blame-time-format')\n   %c - the committer name\n   %C - the committer email\n+  %T - the committer time (see `git-blame-time-format')\n   %s - the commit summary\n \"\n   :group 'git-blame)\n@@ -125,6 +127,14 @@ same length, i.e. the it causes the prefix to be either truncated\n or padded to 30 characters.\n \"\n   :group 'git-blame)\n+\n+(defcustom git-blame-time-format\n+  \"%Y-%m-%d\"\n+  \"The format for date/time values. This format is passed to\n+`format-time-string' function.\n+\"\n+  :group 'git-blame)\n+\n (defcustom git-blame-mouseover-format\n   \"%h %a %A: %s\"\n   \"The format of the description shown when pointing at a line in\n@@ -135,8 +145,10 @@ with the following format keys:\n   %H - the full hash\n   %a - the author name\n   %A - the author email\n+  %t - the author time (see `git-blame-time-format')\n   %c - the committer name\n   %C - the committer email\n+  %T - the committer time (see `git-blame-time-format')\n   %s - the commit summary\n \"\n   :group 'git-blame)\n@@ -393,6 +405,9 @@ See also function `git-blame-mode'.\"\n           (puthash hash info git-blame-cache)\n           info))))\n \n+(defun git-blame-format-time (seconds)\n+  (format-time-string git-blame-time-format (seconds-to-time (string-to-number seconds))))\n+\n (defun git-blame-create-overlay (info start-line num-lines)\n   (with-current-buffer git-blame-file\n     (save-excursion\n@@ -408,8 +423,10 @@ See also function `git-blame-mode'.\"\n                        (?H . ,hash)\n                        (?a . ,(git-blame-get-info info 'author))\n                        (?A . ,(git-blame-get-info info 'author-mail))\n+                       (?t . ,(git-blame-format-time (git-blame-get-info info 'author-time)))\n                        (?c . ,(git-blame-get-info info 'committer))\n                        (?C . ,(git-blame-get-info info 'committer-mail))\n+                       (?T . ,(git-blame-format-time (git-blame-get-info info 'committer-time)))\n                        (?s . ,(git-blame-get-info info 'summary)))))\n           (push ovl git-blame-overlays)\n           (overlay-put ovl 'git-blame info)\n-- \n1.8.3.1\n"},{"id":"222378","messageId":"1372786477-13122-5-git-send-email-sojkam1@fel.cvut.cz","threadId":"34325","inReplyTo":"1372786477-13122-1-git-send-email-sojkam1@fel.cvut.cz","subject":"[PATCH 4/4] git-blame.el: Change the default prefix format","fromName":"Michal Sojka","fromEmail":"sojkam1@fel.cvut.cz","sentAt":"2013-07-02T17:34:37Z","receivedAt":"2013-07-02T17:34:37Z","isPatch":true,"sender":{"key":"sojkam1@fel.cvut.cz","avatar":"https://avatars.githubusercontent.com/u/140542?v=4"},"body":"Now, the format resembles more the default format of `git blame`.\n\nSigned-off-by: Michal Sojka <sojkam1@fel.cvut.cz>\n---\n contrib/emacs/git-blame.el | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el\nindex 5c8933e..74b1486 100644\n--- a/contrib/emacs/git-blame.el\n+++ b/contrib/emacs/git-blame.el\n@@ -102,7 +102,7 @@\n   :group 'git-blame)\n \n (defcustom git-blame-prefix-format\n-  \"%h %20A:\"\n+  \"%h %t %a\"\n   \"The format of the prefix added to each line in `git-blame'\n mode. The format is passed to `format-spec' with the following format keys:\n \n-- \n1.8.3.1\n"}]}