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

[StGit PATCH] stgit new: Do not open editor if --save-template was specified

From
GHGustav Hållberg <gustav@virtutech.com>
Date
Jul 31, 2009, 09:48 UTC
Message-ID
<20090731094718.4516.20444.stgit@lux.e.vtech>
Fixes side-effect of e58f264a3e59a0887c7aaa1e3227cff108ac840d

I'm not sure this is the right way to fix the problem, but an editor should not be opened if "--save-template" was specified to "stg new", as it is used for batch processes.

Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
---
 stgit/commands/new.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/stgit/commands/new.py b/stgit/commands/new.py
index 9fd51c3..158193e 100644
--- a/stgit/commands/new.py
+++ b/stgit/commands/new.py
@@ -67,7 +67,8 @@ def func(parser, options, args):
     cd = gitlib.CommitData(
         tree = stack.head.data.tree, parents = [stack.head], message = '',
         author = gitlib.Person.author(), committer = gitlib.Person.committer())
-    cd = common.update_commit_data(cd, options, allow_edit = True)
+    cd = common.update_commit_data(cd, options,
+                                   allow_edit = not options.save_template)
 
     if options.save_template:
         options.save_template(cd.message)
Message 1 of 1 in “stgit new: Do not open editor if --save-template was specified”
  1. stgit new: Do not open editor if --save-template was specifiedGustav Hållberg, Jul 31, 2009

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.