From 2904e79a08652c236142ecfc38e8e1367cb0213a Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sat, 7 Feb 2009 22:50:51 +0200 Subject: [PATCH] Make magit-status prompt less. * magit.el (magit-status): Only read the top directory with e prefix argument or when we are not inside a Git repository. * magit.texi, NEWS: Document the new behavior. --- NEWS | 3 +++ magit.el | 4 +++- magit.texi | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a18800bb..71c3e138 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,9 @@ Changes in magit 0.7: 'L' shows a more verbose log. Use the prefix arg to specify the range of the log. +* M-x magit-status doesn't prompt anymore for a directory when invoked + from within a Git repository. Use C-u to force a prompt. + * Magit works better with oldish Gits that don't understand "--graph" for example. diff --git a/magit.el b/magit.el index d76cf1d0..221f8dc9 100644 --- a/magit.el +++ b/magit.el @@ -1584,7 +1584,9 @@ in log buffer." (magit-insert-unpushed-commits remote branch)))))) (defun magit-status (dir) - (interactive (list (magit-read-top-dir))) + (interactive (list (or (and (not current-prefix-arg) + (magit-get-top-dir default-directory)) + (magit-read-top-dir)))) (if magit-save-some-buffers (save-some-buffers (eq magit-save-some-buffers 'dontask))) (let* ((topdir (magit-get-top-dir dir)) diff --git a/magit.texi b/magit.texi index 2d25b6bb..4a5d6895 100644 --- a/magit.texi +++ b/magit.texi @@ -100,6 +100,11 @@ Running @kbd{M-x magit-status} displays the main interface of Magit, the status buffer. You can have multiple status buffers active at the same time, each associated with its own Git repository. +When invoking @kbd{M-x magit-status} from within a Git repository, it +will switch to the status buffer of that repository. Otherwise, it +will prompt for a directory. With a rpefix argument, it will always +prompt. + You need to explicitly refresh the status buffer when you have made changes to the repository from outside of Emacs. You can type @kbd{g} in the status buffer itself, or just use @kbd{M-x magit-status}