emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 66a491f 1/2: Fix Bug#11728: show files updated by


From: Alan Third
Subject: [Emacs-diffs] emacs-26 66a491f 1/2: Fix Bug#11728: show files updated by git
Date: Tue, 12 Jun 2018 16:22:04 -0400 (EDT)

branch: emacs-26
commit 66a491fbec005b6a7ba255612ddb6efcf1a4bbcb
Author: Sam Steingold <address@hidden>
Commit: Alan Third <address@hidden>

    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 efe853e..6650c5d 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]