From: Robin Rosenberg <robin.rosenberg@dewire.com>
To: git@vger.kernel.org
Subject: [StGIT PATCH 2/3] Add an optional prefix to the PATCH subject when mailing.
Date: Tue, 03 Oct 2006 23:34:55 +0200 [thread overview]
Message-ID: <20061003213455.26195.63109.stgit@lathund.dewire.com> (raw)
In-Reply-To: <20061003213453.26195.54830.stgit@lathund.dewire.com>
From: Robin Rosenberg <robin.rosenberg@dewire.com>
This is for submitting patches to mailing lists with multiple
projects.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
stgit/commands/mail.py | 15 +++++++++++++++
templates/covermail.tmpl | 2 +-
templates/patchmail.tmpl | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py
index bd56f16..8a713a1 100644
--- a/stgit/commands/mail.py
+++ b/stgit/commands/mail.py
@@ -65,6 +65,7 @@ the following variables:
%(diffstat)s - diff statistics
%(date)s - current date/time
%(version)s - ' version' string passed on the command line (or empty)
+ %(prefix)s - prefix the subject lines's "PATCH" with this
%(patchnr)s - patch number
%(totalnr)s - total number of patches to be sent
%(number)s - empty if only one patch is sent or ' patchnr/totalnr'
@@ -95,6 +96,8 @@ options = [make_option('-a', '--all',
action = 'store_true'),
make_option('-v', '--version', metavar = 'VERSION',
help = 'add VERSION to the [PATCH ...] prefix'),
+ make_option('--prefix', metavar = 'PREFIX',
+ help = 'add PREFIX to the [...PATCH ...] prefix'),
make_option('-t', '--template', metavar = 'FILE',
help = 'use FILE as the message template'),
make_option('-c', '--cover', metavar = 'FILE',
@@ -232,6 +235,11 @@ def __build_cover(tmpl, total_nr, msg_id
else:
version_str = ''
+ if options.prefix:
+ prefix_str = options.prefix + ' '
+ else:
+ prefix_str = ''
+
total_nr_str = str(total_nr)
patch_nr_str = '0'.zfill(len(total_nr_str))
if total_nr > 1:
@@ -243,6 +251,7 @@ def __build_cover(tmpl, total_nr, msg_id
'endofheaders': headers_end,
'date': email.Utils.formatdate(localtime = True),
'version': version_str,
+ 'prefix': prefix_str,
'patchnr': patch_nr_str,
'totalnr': total_nr_str,
'number': number_str}
@@ -312,6 +321,11 @@ def __build_message(tmpl, patch, patch_n
else:
version_str = ''
+ if options.prefix:
+ prefix_str = options.prefix + ' '
+ else:
+ prefix_str = ''
+
total_nr_str = str(total_nr)
patch_nr_str = str(patch_nr).zfill(len(total_nr_str))
if total_nr > 1:
@@ -330,6 +344,7 @@ def __build_message(tmpl, patch, patch_n
rev2 = git_id('%s//top' % patch)),
'date': email.Utils.formatdate(localtime = True),
'version': version_str,
+ 'prefix': prefix_str,
'patchnr': patch_nr_str,
'totalnr': total_nr_str,
'number': number_str,
diff --git a/templates/covermail.tmpl b/templates/covermail.tmpl
index 44cd19e..ba1dd9d 100644
--- a/templates/covermail.tmpl
+++ b/templates/covermail.tmpl
@@ -1,5 +1,5 @@
From: %(maintainer)s
-Subject: [PATCH%(version)s%(number)s] Series short description
+Subject: [%(prefix)sPATCH%(version)s%(number)s] Series short description
Date: %(date)s
%(endofheaders)s
The following series implements...
diff --git a/templates/patchmail.tmpl b/templates/patchmail.tmpl
index 7881993..b0df904 100644
--- a/templates/patchmail.tmpl
+++ b/templates/patchmail.tmpl
@@ -1,5 +1,5 @@
From: %(maintainer)s
-Subject: [PATCH%(version)s%(number)s] %(shortdescr)s
+Subject: [%(prefix)sPATCH%(version)s%(number)s] %(shortdescr)s
Date: %(date)s
%(endofheaders)s
From: %(authname)s <%(authemail)s>
next prev parent reply other threads:[~2006-10-03 21:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-03 21:34 [StGIT PATCH 1/3] Command to move a patch to the top Robin Rosenberg
2006-10-03 21:34 ` Robin Rosenberg [this message]
2006-10-03 21:34 ` [StGIT PATCH 3/3] Fix the --cover option Robin Rosenberg
2006-10-05 21:09 ` [StGIT PATCH] (Repost) Command to move a patch to the top Robin Rosenberg
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=20061003213455.26195.63109.stgit@lathund.dewire.com \
--to=robin.rosenberg@dewire.com \
--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).