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

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

From
Karl Hasselström <kha@treskal.com>
Date
Feb 10, 2008, 20:44 UTC
Message-ID
<20080210204420.17683.1504.stgit@yoghurt>
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'))
Previous: Karl HasselströmNext: Karl Hasselström
Message 9 of 21 in “StGit: kha/safe and kha/experimental updated”
  1. Karl HasselströmFeb 10, 2008
  2. 0/5 Convert "stg new" to the new infrastructureKarl Hasselström, Feb 10, 2008
  3. 1/5 Disable patchlog test for "stg new"Karl Hasselström, Feb 10, 2008
  4. 2/5 Convert "stg new" to the new infrastructureKarl Hasselström, Feb 10, 2008
  5. 3/5 Refactor --author/--committer optionsKarl Hasselström, Feb 10, 2008
  6. Subject: [PATCH] fix stg edit commandPeter Oberndorfer, Feb 12, 2008
  7. Karl HasselströmFeb 12, 2008
  8. Refactor --author/--committer optionsKarl Hasselström, Feb 12, 2008
  9. 4/5 Let "stg new" support more message optionsKarl Hasselström, Feb 10, 2008
  10. 5/5 Emacs mode: use "stg new --file"Karl Hasselström, Feb 10, 2008
  11. David KågedalFeb 11, 2008
  12. Karl HasselströmFeb 11, 2008
  13. 0/2 Convert "stg delete" to the new infrastructureKarl Hasselström, Feb 10, 2008
  14. 1/2 Convert "stg delete" to the new infrastructureKarl Hasselström, Feb 10, 2008
  15. 2/2 Emacs mode: delete patchesKarl Hasselström, Feb 10, 2008
  16. David KågedalFeb 11, 2008
  17. Karl HasselströmFeb 11, 2008
  18. David KågedalFeb 11, 2008
  19. 1/2 Emacs mode: change "stg repair" bindingKarl Hasselström, Feb 11, 2008
  20. 2/2 Emacs mode: delete patchesKarl Hasselström, Feb 11, 2008
  21. Catalin MarinasFeb 12, 2008

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.