aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-05-17 02:45:51 +0300
committerDmitry Gutov2015-05-17 02:47:17 +0300
commit576fba5f58dd61163cf92a0c3f93859e047ecefd (patch)
tree1c0fd679cc6fd1cd16bb6f9e3c6015835f0e5f53
parent496bfe74990d6601d3584cb900643aa77d7b7a78 (diff)
downloademacs-576fba5f58dd61163cf92a0c3f93859e047ecefd.tar.gz
emacs-576fba5f58dd61163cf92a0c3f93859e047ecefd.zip
Display shorter dates in Git annotate output
* lisp/vc/vc-git.el (vc-git-annotate-command): Use the short date format (when not overridden with vc-git-annotate-switches). (vc-git-annotate-time): Support the short format, as well as ISO 8601 that has been used until now (bug#5428).
-rw-r--r--lisp/vc/vc-git.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 059f34eb446..cbf3da3003f 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1054,17 +1054,19 @@ or BRANCH^ (where \"^\" can be repeated)."
1054 1054
1055(defun vc-git-annotate-command (file buf &optional rev) 1055(defun vc-git-annotate-command (file buf &optional rev)
1056 (let ((name (file-relative-name file))) 1056 (let ((name (file-relative-name file)))
1057 (apply #'vc-git-command buf 'async nil "blame" "--date=iso" 1057 (apply #'vc-git-command buf 'async nil "blame" "--date=short"
1058 (append (vc-switches 'git 'annotate) 1058 (append (vc-switches 'git 'annotate)
1059 (list rev "--" name))))) 1059 (list rev "--" name)))))
1060 1060
1061(declare-function vc-annotate-convert-time "vc-annotate" (&optional time)) 1061(declare-function vc-annotate-convert-time "vc-annotate" (&optional time))
1062 1062
1063(defun vc-git-annotate-time () 1063(defun vc-git-annotate-time ()
1064 (and (re-search-forward "[0-9a-f]+[^()]+(.* \\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\) +[0-9]+) " nil t) 1064 (and (re-search-forward "^[0-9a-f]+[^()]+(.*?\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\(:?\\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\\)? *[0-9]+) " nil t)
1065 (vc-annotate-convert-time 1065 (vc-annotate-convert-time
1066 (apply #'encode-time (mapcar (lambda (match) 1066 (apply #'encode-time (mapcar (lambda (match)
1067 (string-to-number (match-string match))) 1067 (if (match-beginning match)
1068 (string-to-number (match-string match))
1069 0))
1068 '(6 5 4 3 2 1 7)))))) 1070 '(6 5 4 3 2 1 7))))))
1069 1071
1070(defun vc-git-annotate-extract-revision-at-line () 1072(defun vc-git-annotate-extract-revision-at-line ()