Add command magit-reset-head-hard.

Intended to be bound to X instead of magit-reset-working-tree for those who
feel it is a more consistent pair for x.  Suggests HEAD and therefore works
like magit-reset-working-tree by default.  Eliminates need to use C-u x.
This commit is contained in:
Hannu Koivisto 2009-10-24 19:57:01 +03:00
parent 8020b0396a
commit ea0812f119

View file

@ -2418,10 +2418,16 @@ branch."
(magit-run-git "reset" (if hard "--hard" "--soft")
(magit-rev-to-git rev))))
(defun magit-reset-head-hard (rev)
(interactive (list (magit-read-rev (format "Hard reset head to")
(or (magit-default-rev)
"HEAD"))))
(magit-reset-head rev t))
(defun magit-reset-working-tree ()
(interactive)
(if (yes-or-no-p "Discard all uncommitted changes? ")
(magit-run-git "reset" "--hard")))
(when (yes-or-no-p "Discard all uncommitted changes? ")
(magit-reset-head-hard "HEAD")))
;;; Rewriting