From ae5b5d4fe0232d86cd57c58475469ac5989f5a3d Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 31 Aug 2008 00:41:22 +0300 Subject: [PATCH] Better indication of "git remote update" in mode line. * magit.el (magit-process-indicator-from-command): New. (magit-run-command): Use it. --- magit.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/magit.el b/magit.el index 5635bb87..fb7912f2 100644 --- a/magit.el +++ b/magit.el @@ -479,6 +479,16 @@ Many Magit faces inherit from this one by default." (concat " " str) "")))) +(defun magit-process-indicator-from-command (cmd args) + (cond ((or (null args) + (not (equal cmd "git"))) + cmd) + ((or (null (cdr args)) + (not (member (car args) '("remote")))) + (car args)) + (t + (concat (car args) " " (cadr args))))) + (defvar magit-process nil) (defun magit-run-command (logline cmd &rest args) @@ -486,9 +496,8 @@ Many Magit faces inherit from this one by default." (error "Git is already running.")) (let ((dir default-directory) (buf (get-buffer-create "*magit-process*"))) - (magit-set-mode-line-process (if (equal cmd "git") - (car args) - cmd)) + (magit-set-mode-line-process + (magit-process-indicator-from-command cmd args)) (save-excursion (set-buffer buf) (setq default-directory dir)