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.
This commit is contained in:
Marius Vollmer 2009-02-07 22:50:51 +02:00
parent 5f1c91c98d
commit 2904e79a08
3 changed files with 11 additions and 1 deletions

3
NEWS
View file

@ -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.

View file

@ -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))

View file

@ -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}