Per discussion of http://article.gmane.org/gmane.emacs.tramp/7439, the
following patch (courtesy of Michael Albinus) will make running magit
over tramp more smoothly.

NB: emacs-trunk has a generic solution so it is not needed if you are
running cutting-edge emacs.

diff --git a/magit.el b/magit.el
index cc61be8..6b8f1ea 100644
--- a/magit.el
+++ b/magit.el
@@ -1480,6 +1480,7 @@ FUNC should leave point at the end of the modified region"
          (error "Git failed"))
       successp)))
 
+(autoload 'dired-uncache "dired")
 (defun magit-process-sentinel (process event)
   (let ((msg (format "Git %s." (substring event 0 -1)))
        (successp (string-match "^finished" event)))
@@ -1487,7 +1488,8 @@ FUNC should leave point at the end of the modified region"
       (let ((inhibit-read-only t))
        (goto-char (point-max))
        (insert msg "\n")
-       (message msg)))
+       (message msg))
+      (dired-uncache default-directory))
     (setq magit-process nil)
     (magit-set-mode-line-process nil)
     (magit-refresh-buffer magit-process-client-buffer)))

Reply via email to