From: Dan Nicolaescu Date: Thu, 3 Jun 2010 23:26:39 +0000 (-0700) Subject: vc-log-incoming/vc-log-outgoing improvements for Git. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~125 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6941ffecb2ae33279b7d111d0073f7412a559e5d;p=emacs.git vc-log-incoming/vc-log-outgoing improvements for Git. * lisp/vc-git.el (vc-git-log-outgoing): Use the same format as the short log. (vc-git-log-incoming): Likewise. Run "git fetch" before the log command. --- diff --git a/etc/NEWS b/etc/NEWS index 58546d31bb6..683b6597f83 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -164,6 +164,9 @@ read a file name from the minibuffer instead of using buffer-file-name. *** New VC commands: vc-log-incoming, vc-log-outgoing, vc-find-conflicted-file. +**** vc-log-incoming for Git runs "git fetch" so that the necessary +data is available locally. + *** New key bindings: C-x v I and C-x v O bound to vc-log-incoming and vc-log-outgoing, respectively. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e037c2579b8..8af8ba4d076 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2010-06-03 Dan Nicolaescu + vc-log-incoming/vc-log-outgoing improvements for Git. + * vc-git.el (vc-git-log-outgoing): Use the same format as the + short log. + (vc-git-log-incoming): Likewise. Run "git fetch" before the log command. + Add bindings for vc-log-incoming and vc-log-outgoing. * vc-hooks.el (vc-prefix-map): Add bindings for vc-log-incoming and vc-log-outgoing. diff --git a/lisp/vc-git.el b/lisp/vc-git.el index 4f67e1b0679..145c44d9b42 100644 --- a/lisp/vc-git.el +++ b/lisp/vc-git.el @@ -622,23 +622,29 @@ for the --graph option." (when (string-match "\\([^\n]+\\)" remote) (setq remote (match-string 1 remote))))))) - (defun vc-git-log-outgoing (buffer remote-location) (interactive) (vc-git-command buffer 0 nil - "log" (if (string= remote-location "") - (concat (vc-git-compute-remote) "..HEAD") - remote-location))) - + "log" + "--no-color" "--graph" "--decorate" "--date=short" + "--pretty=tformat:%d%h %ad %s" "--abbrev-commit" + (concat (if (string= remote-location "") + (vc-git-compute-remote) + remote-location) + "..HEAD"))) (defun vc-git-log-incoming (buffer remote-location) (interactive) + (vc-git-command nil 0 nil "fetch") (vc-git-command buffer 0 nil - "log" (if (string= remote-location "") - (concat "HEAD.." (vc-git-compute-remote)) - remote-location))) + "log" + "--no-color" "--graph" "--decorate" "--date=short" + "--pretty=tformat:%d%h %ad %s" "--abbrev-commit" + (concat "HEAD.." (if (string= remote-location "") + (vc-git-compute-remote) + remote-location)))) (defvar log-view-message-re) (defvar log-view-file-re)