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

[patch 09/11] Allow mailing a given patch list

From
PGPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Date
Sep 16, 2005, 19:35 UTC
Message-ID
<20050916193522.18681.94911.stgit@zion.home.lan>
In-Reply-To
<20050916193511.18681.24189.stgit@zion.home.lan>
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

I tried to mail a cherry-picked subset of my series and that didn't work - using stg export and quilt was even worse, so I had to code something.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
 stgit/commands/mail.py |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -26,7 +26,7 @@ from stgit.config import config
 
 
 help = 'send a patch or series of patches by e-mail'
-usage = """%prog [options] [<patch>]
+usage = """%prog [options] [<patch> [<patch2...]]
 
 Send a patch or a range of patches (defaulting to the applied patches)
 by e-mail using the 'smtpserver' configuration option. The From
@@ -265,9 +265,6 @@ def func(parser, options, args):
     """Send the patches by e-mail using the patchmail.tmpl file as
     a template
     """
-    if len(args) > 1:
-        parser.error('incorrect number of arguments')
-
     if not config.has_option('stgit', 'smtpserver'):
         raise CmdException, 'smtpserver not defined'
     smtpserver = config.get('stgit', 'smtpserver')
@@ -281,11 +278,11 @@ def func(parser, options, args):
 
     applied = crt_series.get_applied()
 
-    if len(args) == 1:
-        if args[0] in applied:
-            patches = [args[0]]
-        else:
-            raise CmdException, 'Patch "%s" not applied' % args[0]
+    if len(args) >= 1:
+        for patch in args:
+            if not patch in applied:
+                raise CmdException, 'Patch "%s" not applied' % patch
+            patches = args
     elif options.all:
         patches = applied
     elif options.range:
Previous: Paolo 'Blaisorblade' GiarrussoNext: Paolo 'Blaisorblade' Giarrusso
Message 10 of 12 in “Fix typo: comitter->committer”
  1. 01/11 Fix typo: comitter->committerPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  2. 02/11 Make "empty patch" checking optional in "series" command.Paolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  3. Catalin MarinasSep 17, 2005
  4. 03/11 stg diff / files: don't update directory cache unless neededPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  5. 04/11 Fix "mail" command when description contains "From" linesPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  6. 05/11 Make "stg files" output match "quilt files" onePaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  7. 06/11 Avoid allowing --undo if it doesn't change anythingPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  8. 07/11 Implement fast-forward when only tree (but not commits) matchPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  9. 08/11 Fix "stg clean" when stack is emptyPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  10. 09/11 Allow mailing a given patch listPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  11. 10/11 Fix "stg mail" address parsing for hyphenPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005
  12. 11/11 Detect description in quilt patchesPaolo 'Blaisorblade' Giarrusso, Sep 16, 2005

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.