Tell people that they are going to do a hard reset.

* magit.el (magit-reset-head): Reflect it in the prompt whether this
is going to be a hard reset or not.  Added optional argument instead
of using current-prefix-arg directly.
* magit.texi: Document it.
This commit is contained in:
Marius Vollmer 2009-03-01 15:06:02 +02:00
parent 44763451f1
commit e6a1fd4e70
2 changed files with 13 additions and 5 deletions

View file

@ -1995,13 +1995,16 @@ in log buffer."
;;; Resetting ;;; Resetting
(defun magit-reset-head (rev) (defun magit-reset-head (rev &optional hard)
(interactive (list (magit-read-rev "Reset head to" (interactive (list (magit-read-rev (format "%s head to"
(if current-prefix-arg
"Hard reset"
"Reset"))
(or (magit-default-rev) (or (magit-default-rev)
"HEAD^")))) "HEAD^"))
current-prefix-arg))
(if rev (if rev
(magit-run-git "reset" (if current-prefix-arg (magit-run-git "reset" (if hard "--hard" "--soft")
"--hard" "--soft")
(magit-rev-to-git rev)))) (magit-rev-to-git rev))))
(defun magit-reset-working-tree () (defun magit-reset-working-tree ()

View file

@ -388,6 +388,11 @@ Type @kbd{X} to reset your working tree and staging area to the most
recently committed state. This will discard your local modifications, recently committed state. This will discard your local modifications,
so be careful. so be careful.
You can give a prefix to @kbd{x} if you want to reset both the current
head and your working tree to a given commit. This is the same as
first using an unprefixed @kbd{x} to reset only the head, and then
using @kbd{X}.
@node Stashing @node Stashing
@chapter Stashing @chapter Stashing