chiark / gitweb /
Add --ack/--sign options to "stg new"
authorKarl Hasselström <kha@treskal.com>
Sat, 6 Oct 2007 07:47:29 +0000 (09:47 +0200)
committerKarl Hasselström <kha@treskal.com>
Sun, 7 Oct 2007 22:14:11 +0000 (00:14 +0200)
Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/new.py
stgit/stack.py

index f192e34ee19d5d4bec0818f9c91a3579795c8338..59671abecd0feed9866b6f39117b6e6d71b80edf 100644 (file)
@@ -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)
index d889f37797c18aee446ae9362f67b17af172675e..4d1a066001d0bd45ba7055ab1e9cda958459629f 100644 (file)
@@ -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()