commit 08468554243b048ce408ff7b4fd8543abecaa4c5 Author: Tom Tromey Date: Wed Feb 15 05:12:18 2017 -0700 vc-log-outgoing fixes for git; add binding to vc-dir * lisp/vc/vc-dir.el (vc-dir-mode-map): Bind "O" to vc-log-outgoing. * lisp/vc/vc-git.el (vc-git-log-outgoing, vc-git-log-incoming): Handle remote-location being nil. Use 'async. (vc-git-log-view-mode): Also truncate lines for log-outgoing and log-incoming. more diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 5374f1c..532bad1 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -255,6 +255,7 @@ vc-dir-mode-map (define-key map "l" 'vc-print-log) ;; C-x v l (define-key map "L" 'vc-print-root-log) ;; C-x v L (define-key map "I" 'vc-log-incoming) ;; C-x v I + (define-key map "O" 'vc-log-outgoing) ;; C-x v O ;; More confusing than helpful, probably ;;(define-key map "R" 'vc-revert) ;; u is taken by vc-dir-unmark. ;;(define-key map "A" 'vc-annotate) ;; g is taken by revert-buffer diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 0c11a7f..be471c3 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -972,12 +972,12 @@ vc-git-print-log (defun vc-git-log-outgoing (buffer remote-location) (interactive) (vc-git-command - buffer 0 nil + buffer 'async nil "log" "--no-color" "--graph" "--decorate" "--date=short" (format "--pretty=tformat:%s" (car vc-git-root-log-format)) "--abbrev-commit" - (concat (if (string= remote-location "") + (concat (if (or (not remote-location) (string= remote-location "")) "@{upstream}" remote-location) "..HEAD"))) @@ -986,12 +986,12 @@ vc-git-log-incoming (interactive) (vc-git-command nil 0 nil "fetch") (vc-git-command - buffer 0 nil + buffer 'async nil "log" "--no-color" "--graph" "--decorate" "--date=short" (format "--pretty=tformat:%s" (car vc-git-root-log-format)) "--abbrev-commit" - (concat "HEAD.." (if (string= remote-location "") + (concat "HEAD.." (if (or (not remote-location) (string= remote-location "")) "@{upstream}" remote-location)))) @@ -1011,7 +1011,7 @@ vc-git-log-view-mode (cadr vc-git-root-log-format) "^commit *\\([0-9a-z]+\\)")) ;; Allow expanding short log entries. - (when (eq vc-log-view-type 'short) + (when (memq vc-log-view-type '(short log-outgoing log-incoming)) (setq truncate-lines t) (set (make-local-variable 'log-view-expanded-log-entry-function) 'vc-git-expanded-log-entry))