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:
parent
8020b0396a
commit
ea0812f119
1 changed files with 8 additions and 2 deletions
10
magit.el
10
magit.el
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue