aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2010-06-05 02:56:22 -0700
committerDan Nicolaescu2010-06-05 02:56:22 -0700
commiteccdfe5fd18f4b573e9eada179242c513b3024b1 (patch)
tree89924493dea6a34b4ebf2d2e8034ffbb84129053
parent409f29191382c875a05516cc69bf3cc4e3cd4592 (diff)
downloademacs-eccdfe5fd18f4b573e9eada179242c513b3024b1.tar.gz
emacs-eccdfe5fd18f4b573e9eada179242c513b3024b1.zip
vc-log-incoming/vc-log-outgoing fixes for Git.
* lisp/vc-git.el (vc-git-log-view-mode): Fix font lock for incoming/outgoing logs. (vc-git-log-outgoing, vc-git-log-incoming): Use @{upstream} instead of vc-git-compute-remote. (vc-git-compute-remote): Remove.
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/vc-git.el28
3 files changed, 17 insertions, 22 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 683b6597f83..f37356dc032 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -167,6 +167,8 @@ read a file name from the minibuffer instead of using buffer-file-name.
167**** vc-log-incoming for Git runs "git fetch" so that the necessary 167**** vc-log-incoming for Git runs "git fetch" so that the necessary
168data is available locally. 168data is available locally.
169 169
170**** vc-log-incoming and vc-log-outgoing for Git require version 1.7 (or newer).
171
170*** New key bindings: C-x v I and C-x v O bound to vc-log-incoming and 172*** New key bindings: C-x v I and C-x v O bound to vc-log-incoming and
171vc-log-outgoing, respectively. 173vc-log-outgoing, respectively.
172 174
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 707bb8ff4c1..8cd1cd39739 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12010-06-05 Dan Nicolaescu <dann@ics.uci.edu>
2
3 vc-log-incoming/vc-log-outgoing fixes for Git.
4 * vc-git.el (vc-git-log-view-mode): Fix font lock for
5 incoming/outgoing logs.
6 (vc-git-log-outgoing, vc-git-log-incoming): Use @{upstream}
7 instead of vc-git-compute-remote.
8 (vc-git-compute-remote): Remove.
9
12010-06-04 Juri Linkov <juri@jurta.org> 102010-06-04 Juri Linkov <juri@jurta.org>
2 11
3 * simple.el (kill-new): Fix logic of kill-do-not-save-duplicates. 12 * simple.el (kill-new): Fix logic of kill-do-not-save-duplicates.
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index 145c44d9b42..62d1940d349 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -606,31 +606,15 @@ for the --graph option."
606 (when start-revision (list start-revision)) 606 (when start-revision (list start-revision))
607 '("--"))))))) 607 '("--")))))))
608 608
609(defun vc-git-compute-remote ()
610 (let ((str (with-output-to-string
611 (with-current-buffer standard-output
612 (vc-git--out-ok "symbolic-ref" "HEAD"))))
613 branch remote)
614 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
615 (progn
616 (setq branch (match-string 2 str))
617 (setq remote
618 (with-output-to-string
619 (with-current-buffer standard-output
620 (vc-git--out-ok "config"
621 (concat "branch." branch ".remote")))))
622 (when (string-match "\\([^\n]+\\)" remote)
623 (setq remote (match-string 1 remote)))))))
624
625(defun vc-git-log-outgoing (buffer remote-location) 609(defun vc-git-log-outgoing (buffer remote-location)
626 (interactive) 610 (interactive)
627 (vc-git-command 611 (vc-git-command
628 buffer 0 nil 612 buffer 0 nil
629 "log" 613 "log"
630 "--no-color" "--graph" "--decorate" "--date=short" 614 "--no-color" "--graph" "--decorate" "--date=short"
631 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit" 615 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit"
632 (concat (if (string= remote-location "") 616 (concat (if (string= remote-location "")
633 (vc-git-compute-remote) 617 "@{upstream}"
634 remote-location) 618 remote-location)
635 "..HEAD"))) 619 "..HEAD")))
636 620
@@ -641,9 +625,9 @@ for the --graph option."
641 buffer 0 nil 625 buffer 0 nil
642 "log" 626 "log"
643 "--no-color" "--graph" "--decorate" "--date=short" 627 "--no-color" "--graph" "--decorate" "--date=short"
644 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit" 628 "--pretty=tformat:%d%h %ad %s" "--abbrev-commit"
645 (concat "HEAD.." (if (string= remote-location "") 629 (concat "HEAD.." (if (string= remote-location "")
646 (vc-git-compute-remote) 630 "@{upstream}"
647 remote-location)))) 631 remote-location))))
648 632
649(defvar log-view-message-re) 633(defvar log-view-message-re)
@@ -657,11 +641,11 @@ for the --graph option."
657 (set (make-local-variable 'log-view-file-re) "\\`a\\`") 641 (set (make-local-variable 'log-view-file-re) "\\`a\\`")
658 (set (make-local-variable 'log-view-per-file-logs) nil) 642 (set (make-local-variable 'log-view-per-file-logs) nil)
659 (set (make-local-variable 'log-view-message-re) 643 (set (make-local-variable 'log-view-message-re)
660 (if (eq vc-log-view-type 'short) 644 (if (not (eq vc-log-view-type 'long))
661 "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" 645 "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)"
662 "^commit *\\([0-9a-z]+\\)")) 646 "^commit *\\([0-9a-z]+\\)"))
663 (set (make-local-variable 'log-view-font-lock-keywords) 647 (set (make-local-variable 'log-view-font-lock-keywords)
664 (if (eq vc-log-view-type 'short) 648 (if (not (eq vc-log-view-type 'long))
665 '( 649 '(
666 ;; Same as log-view-message-re, except that we don't 650 ;; Same as log-view-message-re, except that we don't
667 ;; want the shy group for the tag name. 651 ;; want the shy group for the tag name.