git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org, "David Kågedal" <davidk@lysator.liu.se>
Subject: [StGit PATCH 4/5] Let "stg new" support more message options
Date: Sun, 10 Feb 2008 21:44:28 +0100	[thread overview]
Message-ID: <20080210204420.17683.1504.stgit@yoghurt> (raw)
In-Reply-To: <20080210203846.17683.43153.stgit@yoghurt>

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

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 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'))

  parent reply	other threads:[~2008-02-10 20:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 20:36 StGit: kha/safe and kha/experimental updated Karl Hasselström
2008-02-10 20:40 ` [StGit PATCH 0/5] Convert "stg new" to the new infrastructure Karl Hasselström
2008-02-10 20:43   ` [StGit PATCH 1/5] Disable patchlog test for "stg new" Karl Hasselström
2008-02-10 20:43   ` [StGit PATCH 2/5] Convert "stg new" to the new infrastructure Karl Hasselström
2008-02-10 20:44   ` [StGit PATCH 3/5] Refactor --author/--committer options Karl Hasselström
2008-02-12 22:05     ` Subject: [PATCH] fix stg edit command Peter Oberndorfer
2008-02-12 22:47       ` Karl Hasselström
2008-02-12 23:08         ` [StGit PATCH] Refactor --author/--committer options Karl Hasselström
2008-02-10 20:44   ` Karl Hasselström [this message]
2008-02-10 20:46   ` [StGit PATCH 5/5] Emacs mode: use "stg new --file" Karl Hasselström
2008-02-11  9:25     ` David Kågedal
2008-02-11  9:47       ` Karl Hasselström
2008-02-10 20:47 ` [StGit PATCH 0/2] Convert "stg delete" to the new infrastructure Karl Hasselström
2008-02-10 20:48   ` [StGit PATCH 1/2] " Karl Hasselström
2008-02-10 20:54   ` [StGit PATCH 2/2] Emacs mode: delete patches Karl Hasselström
2008-02-11  9:42     ` David Kågedal
2008-02-11  9:51       ` Karl Hasselström
2008-02-11 10:12         ` David Kågedal
2008-02-11 22:25           ` [StGit PATCH 1/2] Emacs mode: change "stg repair" binding Karl Hasselström
2008-02-11 22:26           ` [StGit PATCH v2 2/2] Emacs mode: delete patches Karl Hasselström
2008-02-12 17:54 ` StGit: kha/safe and kha/experimental updated Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080210204420.17683.1504.stgit@yoghurt \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=davidk@lysator.liu.se \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).