{"thread":{"id":"15508","subject":"[StGit PATCH] Autosign newly created patches","startedAt":"2008-09-12T21:55:56Z","lastAt":"2008-09-15T07:43:15Z","messageCount":4,"participants":["Catalin Marinas","Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"90609","messageId":"20080912215515.10270.32667.stgit@localhost.localdomain","threadId":"15508","inReplyTo":null,"subject":"[StGit PATCH] Autosign newly created patches","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-09-12T21:55:56Z","receivedAt":"2008-09-12T21:55:56Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"This patch adds the autosign configuration variable which is checked by\nthe \"new\" command to automatically sign the patch message.\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n\nBTW, what happened to the patchdescr.tmpl file? It doesn't seem to be\nused anymore, however one can save a template file\n\n examples/gitconfig    |    3 +++\n stgit/commands/new.py |    8 +++++++-\n 2 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/examples/gitconfig b/examples/gitconfig\nindex 4a36202..9efc089 100644\n--- a/examples/gitconfig\n+++ b/examples/gitconfig\n@@ -14,6 +14,9 @@\n \t# Automatically Bcc the address below\n \t#autobcc = your.name@yourcompany.com\n \n+\t# Automatically sign newly created patches\n+\t#autosign = Signed-off-by\n+\n \t# Set to 'yes' if you don't want to use the 'resolved' command.\n \t# 'refresh' will automatically mark the conflicts as resolved\n \t#autoresolved = no\ndiff --git a/stgit/commands/new.py b/stgit/commands/new.py\nindex eb45e1b..4a58d52 100644\n--- a/stgit/commands/new.py\n+++ b/stgit/commands/new.py\n@@ -21,6 +21,7 @@ from optparse import make_option\n from stgit import argparse, utils\n from stgit.commands import common\n from stgit.lib import git as gitlib, transaction\n+from stgit.config import config\n \n help = 'create a new patch and make it the topmost one'\n usage = \"\"\"%prog [options] [name]\n@@ -72,8 +73,13 @@ def func(parser, options, args):\n \n     # Add Signed-off-by: or similar.\n     if options.sign_str != None:\n+        sign_str = options.sign_str\n+    else:\n+        sign_str = config.get(\"stgit.autosign\")\n+\n+    if sign_str != None:\n         cd = cd.set_message(\n-            utils.add_sign_line(cd.message, options.sign_str,\n+            utils.add_sign_line(cd.message, sign_str,\n                                 cd.committer.name, cd.committer.email))\n \n     if options.save_template:\n"},{"id":"90654","messageId":"20080914083728.GB30664@diana.vm.bytemark.co.uk","threadId":"15508","inReplyTo":"20080912215515.10270.32667.stgit@localhost.localdomain","subject":"Re: [StGit PATCH] Autosign newly created patches","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-09-14T08:37:28Z","receivedAt":"2008-09-14T08:37:28Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-09-12 22:55:56 +0100, Catalin Marinas wrote:\n\n> This patch adds the autosign configuration variable which is checked\n> by the \"new\" command to automatically sign the patch message.\n\nSounds useful. I have a sign-off command in my .emacs, but I expect\nthis would be useful for those who don't.\n\n> BTW, what happened to the patchdescr.tmpl file? It doesn't seem to\n> be used anymore, however one can save a template file\n\nI don't know. I don't use it myself, so it's perfectly possible that\nI've broken it without noticing, seeing as there is no test suite\ncoverage ...\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"90692","messageId":"b0943d9e0809141405u6e309f11q80edcfd59eb942dd@mail.gmail.com","threadId":"15508","inReplyTo":"20080914083728.GB30664@diana.vm.bytemark.co.uk","subject":"Re: [StGit PATCH] Autosign newly created patches","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-09-14T21:05:04Z","receivedAt":"2008-09-14T21:05:04Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"2008/9/14 Karl Hasselström <kha@treskal.com>:\n> On 2008-09-12 22:55:56 +0100, Catalin Marinas wrote:\n>\n>> This patch adds the autosign configuration variable which is checked\n>> by the \"new\" command to automatically sign the patch message.\n>\n> Sounds useful. I have a sign-off command in my .emacs, but I expect\n> this would be useful for those who don't.\n\nI use emacs for writing code but not that much for stgit commands (I\nprefer the shell).\n\n>> BTW, what happened to the patchdescr.tmpl file? It doesn't seem to\n>> be used anymore, however one can save a template file\n>\n> I don't know. I don't use it myself, so it's perfectly possible that\n> I've broken it without noticing, seeing as there is no test suite\n> coverage ...\n\nThere isn't a test but the command description suggests that\npatchdesr.tmpl file will be used if present.\n\nShould we keep this feature? The only case where I was using it was\nfor automatic signed-off-by line.\n\n-- \nCatalin\n"},{"id":"90716","messageId":"20080915074315.GA14452@diana.vm.bytemark.co.uk","threadId":"15508","inReplyTo":"b0943d9e0809141405u6e309f11q80edcfd59eb942dd@mail.gmail.com","subject":"Re: [StGit PATCH] Autosign newly created patches","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-09-15T07:43:15Z","receivedAt":"2008-09-15T07:43:15Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-09-14 22:05:04 +0100, Catalin Marinas wrote:\n\n> There isn't a test but the command description suggests that\n> patchdesr.tmpl file will be used if present.\n>\n> Should we keep this feature? The only case where I was using it was\n> for automatic signed-off-by line.\n\nI don't really have an opinion, as I don't use it.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}