stgit.el patches
cover stgit.el patches
These three patches updates stgit.el. They don't depend on each other and can be applied independently.
---
David Kågedal (3):
stgit.el: Adapt to new output from stg series. stgit.el: Added numeric prefix argument to push and pop commands. stgit.el: Added undo command
contrib/stgit.el | 36 ++++++++++++++++++++++++++---------- 1 files changed, 26 insertions(+), 10 deletions(-)
Signature · 1 line
Signature
PATCH 1/3 stgit.el: Added undo command
Bound it to the two standard bindings C-/ and C-_.
--- contrib/stgit.el | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-)
contrib/stgit.el +13 -1
@@ -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)
Re: [StGit PATCH 1/3] stgit.el: Added undo command
contrib/stgit.el Argument DIR is the repository path." · line 170
Quoted 4 lines · David Kågedal
Bound it to the two standard bindings C-/ and C-_.
contrib/stgit.el +2
-0+ (define-key stgit-mode-map [(control ?/)] 'stgit-undo) + (define-key stgit-mode-map "\C-_" 'stgit-undo))
Hmm, why do you spell control in two different ways?
Signature · 2 lines
Karl Hasselström, [email protected] www.treskal.com/kalle
Re: [StGit PATCH 1/3] stgit.el: Added undo command
Quoted 8 lines · Karl Hasselström
contrib/stgit.el Argument DIR is the repository path." · line 170
Quoted 4 lines · David Kågedal
Bound it to the two standard bindings C-/ and C-_.
contrib/stgit.el +2
-0+ (define-key stgit-mode-map [(control ?/)] 'stgit-undo) + (define-key stgit-mode-map "\C-_" 'stgit-undo))Hmm, why do you spell control in two different ways?
I usually use the "\C-x" syntax, but for some reason that didn't work with "\C-/", so I used another syntax. I'm not sure how compatible that is with XEmacs, though.
Signature · 1 line
David Kågedal
PATCH 2/3 stgit.el: Added numeric prefix argument to push and pop commands.
In reply to David KågedalBy using a numerical prefix (or simply C-u) it is possible to push or pop more than one patch.
--- contrib/stgit.el | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-)
contrib/stgit.el +11 -8
@@ -276,16 +276,19 @@ Commands: (stgit-capture-output nil (stgit-run "uncommit" "-n" (number-to-string arg))) (stgit-refresh)) -(defun stgit-push-next () - "Push the first unapplied patch" - (interactive) - (stgit-capture-output nil (stgit-run "push")) +(defun stgit-push-next (npatches) + "Push the first unapplied patch. +With numeric prefix argument, push that many patches." + (interactive "p") + (stgit-capture-output nil (stgit-run "push" "-n" + (number-to-string npatches))) (stgit-refresh)) -(defun stgit-pop-next () - "Pop the topmost applied patch" - (interactive) - (stgit-capture-output nil (stgit-run "pop")) +(defun stgit-pop-next (npatches) + "Pop the topmost applied patch. +With numeric prefix argument, pop that many patches." + (interactive "p") + (stgit-capture-output nil (stgit-run "pop" "-n" (number-to-string npatches))) (stgit-refresh)) (defun stgit-applied-at-point ()
PATCH 3/3 stgit.el: Adapt to new output from stg series.
In reply to David Kågedal--- contrib/stgit.el | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
contrib/stgit.el +2 -1
@@ -131,7 +131,8 @@ Argument DIR is the repository path." (when (memq patchsym stgit-marked-patches) (replace-match "*" nil nil nil 2) (setq marked (cons patchsym marked))))) - ((looking-at "stg series: Branch \".*\" not initialised") + ((or (looking-at "stg series: Branch \".*\" not initialised") + (looking-at "stg series: .*: branch not initialized")) (forward-line 1) (insert "Run M-x stgit-init to initialise"))) (forward-line 1))