From 66a491fbec005b6a7ba255612ddb6efcf1a4bbcb Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Wed, 1 Nov 2017 19:13:46 -0400 Subject: [PATCH] Fix Bug#11728: show files updated by git * lisp/vc/vc-git.el (vc-git--pushpull): Accept extra-args and set `compilation-error-regexp-alist' to `vc-git-error-regexp-alist'. (vc-git-pull): Pass "--stat" as `extra-args' to `vc-git--pushpull'. (vc-git-push): Pass "" as `extra-args' to `vc-git--pushpull'. --- lisp/vc/vc-git.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index efe853e5eeb..6650c5d764a 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -866,7 +866,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.") ;; To be called via vc-pull from vc.el, which requires vc-dispatcher. (declare-function vc-compilation-mode "vc-dispatcher" (backend)) -(defun vc-git--pushpull (command prompt) +(defun vc-git--pushpull (command prompt extra-args) "Run COMMAND (a string; either push or pull) on the current Git branch. If PROMPT is non-nil, prompt for the Git command to run." (let* ((root (vc-git-root default-directory)) @@ -891,9 +891,11 @@ If PROMPT is non-nil, prompt for the Git command to run." (vc-run-delayed (vc-compilation-mode 'git) (setq-local compile-command - (concat git-program " " command " " + (concat git-program " " command " " extra-args " " (if args (mapconcat 'identity args " ") ""))) (setq-local compilation-directory root) + (setq-local compilation-error-regexp-alist + vc-git-error-regexp-alist) ;; Either set `compilation-buffer-name-function' locally to nil ;; or use `compilation-arguments' to set `name-function'. ;; See `compilation-buffer-name'. @@ -907,13 +909,13 @@ If PROMPT is non-nil, prompt for the Git command to run." "Pull changes into the current Git branch. Normally, this runs \"git pull\". If PROMPT is non-nil, prompt for the Git command to run." - (vc-git--pushpull "pull" prompt)) + (vc-git--pushpull "pull" prompt "--stat")) (defun vc-git-push (prompt) "Push changes from the current Git branch. Normally, this runs \"git push\". If PROMPT is non-nil, prompt for the Git command to run." - (vc-git--pushpull "push" prompt)) + (vc-git--pushpull "push" prompt "")) (defun vc-git-merge-branch () "Merge changes into the current Git branch. -- 2.39.2