summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-12-06 22:18:03 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-12-06 22:18:03 +0000
commit0d3f8a78406be78d354503171be17391518957c8 (patch)
treeeb4a5b141052c2085651e7875b5509f30f15e517
parentcebf8ec6d91c0199eed87a182b69cebbb1d9ffbb (diff)
downloademacs-0d3f8a78406be78d354503171be17391518957c8.tar.gz
* vc-git.el (vc-git-print-log): Handle a limit argument. Display
the short log in graph form and with labels. (vc-git-log-view-mode): Handle labels.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/vc-git.el33
2 files changed, 22 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 38a9a1c0817..605f395ab43 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
2009-12-06 Dan Nicolaescu <dann@ics.uci.edu>
+ * vc-git.el (vc-git-print-log): Handle a limit argument. Display
+ the short log in graph form and with labels.
+ (vc-git-log-view-mode): Handle labels.
+
Make vc-revert change VC state from 'added to 'unregistered.
* vc-git.el (vc-git-revert): Call git reset first.
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index f44679d4333..be466cba8bc 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -551,15 +551,15 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(let ((inhibit-read-only t))
(with-current-buffer
buffer
- (if shortlog
- (vc-git-command buffer 'async files
- "log" ;; "--graph"
- "--date=short" "--pretty=format:%h %ad %s" "--abbrev-commit"
- "--")
- (vc-git-command buffer 'async files
- "rev-list" ;; "--graph"
- "--pretty" "HEAD" "--")))
- (when limit 'limit-unsupported))))
+ (apply 'vc-git-command buffer
+ 'async files
+ (append
+ '("log")
+ (when shortlog
+ '("--graph" "--decorate"
+ "--date=short" "--pretty=format:%d%h %ad %s" "--abbrev-commit"))
+ (when limit (list "-n" (format "%s" limit)))
+ '("--")))))))
(defvar log-view-message-re)
(defvar log-view-file-re)
@@ -576,16 +576,19 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
(set (make-local-variable 'log-view-per-file-logs) nil)
(set (make-local-variable 'log-view-message-re)
(if vc-short-log
- "^\\(?:[*/\\| ]+ \\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
+ "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
"^commit *\\([0-9a-z]+\\)"))
(set (make-local-variable 'log-view-font-lock-keywords)
(if vc-short-log
- (append
- `((,log-view-message-re
- (1 'change-log-acknowledgement)
- (2 'change-log-date))))
+ '(
+ ;; Same as log-view-message-re, except that we don't
+ ;; want the shy group for the tag name.
+ ("^\\(?:[*/\\| ]+ \\)?\\( ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
+ (1 'highlight nil lax)
+ (2 'change-log-acknowledgement)
+ (3 'change-log-date)))
(append
- `((,log-view-message-re (1 'change-log-acknowledgement)))
+ `((,log-view-message-re (1 'change-log-acknowledgement)))
;; Handle the case:
;; user: foo@bar
'(("^Author:[ \t]+\\([A-Za-z0-9_.+-]+@[A-Za-z0-9_.-]+\\)"