[StGit PATCH 4/5] Let "stg new" support more message options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Let "stg new" support --file, and --save-template in addition to
--message. This is useful for scripting.

Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx>

---

 stgit/commands/new.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


diff --git a/stgit/commands/new.py b/stgit/commands/new.py
index d44b8cc..43414f5 100644
--- a/stgit/commands/new.py
+++ b/stgit/commands/new.py
@@ -37,10 +37,8 @@ If no name is given for the new patch, one is generated from the first
 line of the commit message."""
 
 directory = common.DirectoryHasRepositoryLib()
-options = [make_option('-m', '--message',
-                       help = 'use MESSAGE as the patch description'),
-           ] + (utils.make_author_committer_options()
-                + utils.make_sign_options())
+options = (utils.make_author_committer_options()
+           + utils.make_message_options() + utils.make_sign_options())
 
 def func(parser, options, args):
     """Create a new patch."""
@@ -79,6 +77,10 @@ def func(parser, options, args):
             utils.add_sign_line(cd.message, options.sign_str,
                                 cd.committer.name, cd.committer.email))
 
+    if options.save_template:
+        options.save_template(cd.message)
+        return utils.STGIT_SUCCESS
+
     # Let user edit the commit message manually.
     if not options.message:
         cd = cd.set_message(utils.edit_string(cd.message, '.stgit-new.txt'))

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux