git-wip is unlike all other git commands in that it is routinely executed after
every save. As such, do not clutter up the echo area with reports of git-wip's
invocation, nor its termination; these are normal events, and it is
disconcerting to see a successful save without the normal Emacs "Wrote ..."
echo-area message: without this, that gets overwritten twice, once by a
notification that git-wip has been run, then with "git finished". This
also tends to overwrite the magit-wip-echo-area-message.
So quieten both messages (but leave the exit message if git-wip fails, since
that is an abnormal condition that someone relying on git-wip might well care
about.)
---
magit-wip.el | 2 +-
magit.el | 17 +++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/magit-wip.el b/magit-wip.el
index b5efa5e..b755f3b 100644
--- a/magit-wip.el
+++ b/magit-wip.el
@@ -136,7 +136,7 @@ ref."
(?f . ,(buffer-file-name))
(?g . ,top-dir))))
(when (and top-dir (file-writable-p top-dir))
- (magit-run-git-async "wip" "save"
+ (magit-run-git-async-silently "wip" "save"
(format-spec magit-wip-commit-message spec)
"--editor" "--" name)
(when magit-wip-echo-area-message
diff --git a/magit.el b/magit.el
index ad5569d..e1389c4 100644
--- a/magit.el
+++ b/magit.el
@@ -2165,6 +2165,7 @@ magit-topgit and magit-svn"
(defvar magit-process nil)
(defvar magit-process-client-buffer nil)
+(defvar magit-process-silently nil)
(defvar magit-process-buffer-name "*magit-process*"
"Buffer name for running git commands.")
@@ -2274,12 +2275,15 @@ magit-topgit and magit-svn"
(let ((inhibit-read-only t))
(goto-char (point-max))
(insert msg "\n")
- (message (if successp msg
- (format "%s Hit %s or see buffer %s for details."
- msg key (current-buffer)))))
+ (if (or (not magit-process-silently)
+ (not successp))
+ (message (if successp msg
+ (format "%s Hit %s or see buffer %s for details."
+ msg key (current-buffer))))))
(unless (memq (process-status process) '(run open))
(dired-uncache default-directory)))
(setq magit-process nil)
+ (setq magit-process-silently nil)
(magit-set-mode-line-process nil)
(when (and (buffer-live-p magit-process-client-buffer)
(with-current-buffer magit-process-client-buffer
@@ -2346,12 +2350,17 @@ magit-topgit and magit-svn"
nil nil nil nil input)))
(defun magit-run-git-async (&rest args)
- (message "Running %s %s" magit-git-executable (mapconcat 'identity args " "))
+ (unless magit-process-silently
+ (message "Running %s %s" magit-git-executable (mapconcat 'identity args "
")))
(magit-run* (append (cons magit-git-executable
magit-git-standard-options)
args)
nil nil nil t))
+(defun magit-run-git-async-silently (&rest args)
+ (setq magit-process-silently t)
+ (apply 'magit-run-git-async args))
+
(defun magit-run-async-with-input (input cmd &rest args)
(magit-run* (cons cmd args) nil nil nil t input))
--
1.8.1.5.161.ge260ee8
--
---
You received this message because you are subscribed to the Google Groups
"magit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.