git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH 2/3] stgit.el: Added numeric prefix argument to push and pop commands.

From
David Kågedal <davidk@lysator.liu.se>
Date
Oct 30, 2008, 09:52 UTC
Message-ID
<20081030095253.10290.43869.stgit@krank>
In-Reply-To
<20081030095221.10290.58637.stgit@krank>

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 ()
Previous: David KågedalNext: David Kågedal
Message 5 of 6 in “stgit.el patches”
  1. 0/3 stgit.el patchesDavid Kågedal, Oct 30, 2008
  2. 1/3 stgit.el: Added undo commandDavid Kågedal, Oct 30, 2008
  3. Karl HasselströmOct 30, 2008
  4. David KågedalOct 30, 2008
  5. 2/3 stgit.el: Added numeric prefix argument to push and pop commands.David Kågedal, Oct 30, 2008
  6. 3/3 stgit.el: Adapt to new output from stg series.David Kågedal, Oct 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.