* [StGit PATCH 0/3] stgit.el patches
@ 2008-10-30 9:52 David Kågedal
2008-10-30 9:52 ` [StGit PATCH 1/3] stgit.el: Added undo command David Kågedal
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: David Kågedal @ 2008-10-30 9:52 UTC (permalink / raw)
To: kha, catalin.marinas; +Cc: git
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [StGit PATCH 1/3] stgit.el: Added undo command
2008-10-30 9:52 [StGit PATCH 0/3] stgit.el patches David Kågedal
@ 2008-10-30 9:52 ` David Kågedal
2008-10-30 11:57 ` Karl Hasselström
2008-10-30 9:52 ` [StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands David Kågedal
2008-10-30 9:52 ` [StGit PATCH 3/3] stgit.el: Adapt to new output from stg series David Kågedal
2 siblings, 1 reply; 6+ messages in thread
From: David Kågedal @ 2008-10-30 9:52 UTC (permalink / raw)
To: kha, catalin.marinas; +Cc: git
Bound it to the two standard bindings C-/ and C-_.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
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)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [StGit PATCH 1/3] stgit.el: Added undo command
2008-10-30 9:52 ` [StGit PATCH 1/3] stgit.el: Added undo command David Kågedal
@ 2008-10-30 11:57 ` Karl Hasselström
2008-10-30 14:57 ` David Kågedal
0 siblings, 1 reply; 6+ messages in thread
From: Karl Hasselström @ 2008-10-30 11:57 UTC (permalink / raw)
To: David Kågedal; +Cc: catalin.marinas, git
On 2008-10-30 10:52:48 +0100, David Kågedal wrote:
> Bound it to the two standard bindings C-/ and C-_.
> + (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?
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [StGit PATCH 1/3] stgit.el: Added undo command
2008-10-30 11:57 ` Karl Hasselström
@ 2008-10-30 14:57 ` David Kågedal
0 siblings, 0 replies; 6+ messages in thread
From: David Kågedal @ 2008-10-30 14:57 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git, catalin marinas
Karl Hasselström <kha@treskal.com> writes:
> On 2008-10-30 10:52:48 +0100, David Kågedal wrote:
>
>> Bound it to the two standard bindings C-/ and C-_.
>
>> + (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.
--
David Kågedal
^ permalink raw reply [flat|nested] 6+ messages in thread
* [StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands.
2008-10-30 9:52 [StGit PATCH 0/3] stgit.el patches David Kågedal
2008-10-30 9:52 ` [StGit PATCH 1/3] stgit.el: Added undo command David Kågedal
@ 2008-10-30 9:52 ` David Kågedal
2008-10-30 9:52 ` [StGit PATCH 3/3] stgit.el: Adapt to new output from stg series David Kågedal
2 siblings, 0 replies; 6+ messages in thread
From: David Kågedal @ 2008-10-30 9:52 UTC (permalink / raw)
To: kha, catalin.marinas; +Cc: git
By using a numerical prefix (or simply C-u) it is possible to push or
pop more than one patch.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
contrib/stgit.el | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/contrib/stgit.el b/contrib/stgit.el
index e6b7d70..9907952 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -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 ()
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [StGit PATCH 3/3] stgit.el: Adapt to new output from stg series.
2008-10-30 9:52 [StGit PATCH 0/3] stgit.el patches David Kågedal
2008-10-30 9:52 ` [StGit PATCH 1/3] stgit.el: Added undo command David Kågedal
2008-10-30 9:52 ` [StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands David Kågedal
@ 2008-10-30 9:52 ` David Kågedal
2 siblings, 0 replies; 6+ messages in thread
From: David Kågedal @ 2008-10-30 9:52 UTC (permalink / raw)
To: kha, catalin.marinas; +Cc: git
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
contrib/stgit.el | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/contrib/stgit.el b/contrib/stgit.el
index 9907952..d0f19c3 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -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))
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-10-30 14:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 9:52 [StGit PATCH 0/3] stgit.el patches David Kågedal
2008-10-30 9:52 ` [StGit PATCH 1/3] stgit.el: Added undo command David Kågedal
2008-10-30 11:57 ` Karl Hasselström
2008-10-30 14:57 ` David Kågedal
2008-10-30 9:52 ` [StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands David Kågedal
2008-10-30 9:52 ` [StGit PATCH 3/3] stgit.el: Adapt to new output from stg series David Kågedal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).