Git development
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@gmail.com>
To: git@vger.kernel.org
Cc: "Karl Hasselström" <kha@treskal.com>
Subject: [StGit PATCH] Autosign newly created patches
Date: Fri, 12 Sep 2008 22:55:56 +0100	[thread overview]
Message-ID: <20080912215515.10270.32667.stgit@localhost.localdomain> (raw)

This patch adds the autosign configuration variable which is checked by
the "new" command to automatically sign the patch message.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---

BTW, what happened to the patchdescr.tmpl file? It doesn't seem to be
used anymore, however one can save a template file

 examples/gitconfig    |    3 +++
 stgit/commands/new.py |    8 +++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/examples/gitconfig b/examples/gitconfig
index 4a36202..9efc089 100644
--- a/examples/gitconfig
+++ b/examples/gitconfig
@@ -14,6 +14,9 @@
 	# Automatically Bcc the address below
 	#autobcc = your.name@yourcompany.com
 
+	# Automatically sign newly created patches
+	#autosign = Signed-off-by
+
 	# Set to 'yes' if you don't want to use the 'resolved' command.
 	# 'refresh' will automatically mark the conflicts as resolved
 	#autoresolved = no
diff --git a/stgit/commands/new.py b/stgit/commands/new.py
index eb45e1b..4a58d52 100644
--- a/stgit/commands/new.py
+++ b/stgit/commands/new.py
@@ -21,6 +21,7 @@ from optparse import make_option
 from stgit import argparse, utils
 from stgit.commands import common
 from stgit.lib import git as gitlib, transaction
+from stgit.config import config
 
 help = 'create a new patch and make it the topmost one'
 usage = """%prog [options] [name]
@@ -72,8 +73,13 @@ def func(parser, options, args):
 
     # Add Signed-off-by: or similar.
     if options.sign_str != None:
+        sign_str = options.sign_str
+    else:
+        sign_str = config.get("stgit.autosign")
+
+    if sign_str != None:
         cd = cd.set_message(
-            utils.add_sign_line(cd.message, options.sign_str,
+            utils.add_sign_line(cd.message, sign_str,
                                 cd.committer.name, cd.committer.email))
 
     if options.save_template:

             reply	other threads:[~2008-09-12 22:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-12 21:55 Catalin Marinas [this message]
2008-09-14  8:37 ` [StGit PATCH] Autosign newly created patches Karl Hasselström
2008-09-14 21:05   ` Catalin Marinas
2008-09-15  7:43     ` Karl Hasselström

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=20080912215515.10270.32667.stgit@localhost.localdomain \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.com \
    /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