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

[StGit PATCH 1/8] Add --ack/--sign options to "stg new"

From
Karl Hasselström <kha@treskal.com>
Date
Oct 7, 2007, 23:17 UTC
Message-ID
<20071007231718.12626.20660.stgit@yoghurt>
In-Reply-To
<20071007231446.12626.14259.stgit@yoghurt>
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
 stgit/commands/new.py |    6 ++++--
 stgit/stack.py        |   10 +++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/stgit/commands/new.py b/stgit/commands/new.py
index f192e34..59671ab 100644
--- a/stgit/commands/new.py
+++ b/stgit/commands/new.py
@@ -54,7 +54,8 @@ options = [make_option('-m', '--message',
            make_option('--commname',
                        help = 'use COMMNAME as the committer name'),
            make_option('--commemail',
-                       help = 'use COMMEMAIL as the committer e-mail')]
+                       help = 'use COMMEMAIL as the committer e-mail')
+           ] + make_sign_options()
 
 
 def func(parser, options, args):
@@ -79,4 +80,5 @@ def func(parser, options, args):
                          author_email = options.authemail,
                          author_date = options.authdate,
                          committer_name = options.commname,
-                         committer_email = options.commemail)
+                         committer_email = options.commemail,
+                         sign_str = options.sign_str)
diff --git a/stgit/stack.py b/stgit/stack.py
index d889f37..4d1a066 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -847,7 +847,7 @@ class Series(PatchSet):
                   top = None, bottom = None, commit = True,
                   author_name = None, author_email = None, author_date = None,
                   committer_name = None, committer_email = None,
-                  before_existing = False):
+                  before_existing = False, sign_str = None):
         """Creates a new patch, either pointing to an existing commit object,
         or by creating a new commit object.
         """
@@ -865,13 +865,17 @@ class Series(PatchSet):
 
         # TODO: move this out of the stgit.stack module, it is really
         # for higher level commands to handle the user interaction
+        def sign(msg):
+            return add_sign_line(msg, sign_str,
+                                 committer_name or git.committer().name,
+                                 committer_email or git.committer().email)
         if not message and can_edit:
             descr = edit_file(
-                self, None,
+                self, sign(''),
                 'Please enter the description for the patch above.',
                 show_patch)
         else:
-            descr = message
+            descr = sign(message)
 
         head = git.get_head()
 
Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 11 in “Miscellaneous fixes and improvements”
  1. 0/8 Miscellaneous fixes and improvementsKarl Hasselström, Oct 7, 2007
  2. 1/8 Add --ack/--sign options to "stg new"Karl Hasselström, Oct 7, 2007
  3. 2/8 New test: "stg pop --keep"Karl Hasselström, Oct 7, 2007
  4. 3/8 Fix up the help text for "stg edit"Karl Hasselström, Oct 7, 2007
  5. 4/8 Don't split long and short description in "stg edit"Karl Hasselström, Oct 7, 2007
  6. David BrownOct 7, 2007
  7. Karl HasselströmOct 8, 2007
  8. 5/8 Make a common superclass for all StGit exceptionsKarl Hasselström, Oct 7, 2007
  9. 6/8 Simplify debug level error checkingKarl Hasselström, Oct 7, 2007
  10. 7/8 Discard stderr output from git-rev-parseKarl Hasselström, Oct 7, 2007
  11. 8/8 Remove the --force flag to "stg rebase" and "stg pull"Karl Hasselström, Oct 7, 2007

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.