From f3684678515d865fa1a5eadc39bf680c83dd92e8 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sat, 6 Oct 2007 09:47:29 +0200 Subject: [PATCH] Add --ack/--sign options to "stg new" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Organization: Straylight/Edgeware From: Karl Hasselström Signed-off-by: Karl Hasselström --- 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() -- [mdw]