[StGit PATCH 1/3] stgit.el: Added undo command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bound it to the two standard bindings C-/ and C-_.

Signed-off-by: David Kågedal <davidk@xxxxxxxxxxxxxx>
---
 contrib/stgit.el |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/contrib/stgit.el b/contrib/stgit.el
index aafefaf..e6b7d70 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -165,7 +165,9 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
   (define-key stgit-mode-map "G"   'stgit-goto)
   (define-key stgit-mode-map "="   'stgit-show)
-  (define-key stgit-mode-map "D"   'stgit-delete))
+  (define-key stgit-mode-map "D"   'stgit-delete)
+  (define-key stgit-mode-map [(control ?/)] 'stgit-undo)
+  (define-key stgit-mode-map "\C-_" 'stgit-undo))
 
 (defun stgit-mode ()
   "Major mode for interacting with StGit.
@@ -408,4 +410,14 @@ Commands:
   (interactive)
   (describe-function 'stgit-mode))
 
+(defun stgit-undo (&optional arg)
+  "Run stg undo.
+With prefix argument, run it with the --hard flag."
+  (interactive "P")
+  (stgit-capture-output nil
+    (if arg
+        (stgit-run "undo" "--hard")
+      (stgit-run "undo")))
+  (stgit-refresh))
+
 (provide 'stgit)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux