From: Joe Perches <joe@perches.com>
To: git@vger.kernel.org
Cc: jeffrey.t.kirsher@intel.com
Subject: [PATCH] git-send-email: Add auto-cc to all body signatures
Date: Wed, 07 Dec 2011 18:58:39 -0800 [thread overview]
Message-ID: <1323313119.1762.58.camel@joe2Laptop> (raw)
In-Reply-To: <1311903782.20837.42.camel@jtkirshe-mobl>
Many types of signatures are used by various projects.
The most common type is formatted:
"[some_signature_type]-by: First Last <email@domain.tld>"
e.g:
"Reported-by: First Last <email@domain.tld>" (no quotes are used)
Make git-send-email use these signatures as "CC:" entries.
Add command line option --suppress-cc=signatures to avoid
adding these entries to the cc.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
Documentation/git-send-email.txt | 3 ++-
git-send-email.perl | 11 ++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 327233c..17ea825 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -246,8 +246,9 @@ Automating
patch body (commit message) except for self (use 'self' for that).
- 'sob' will avoid including anyone mentioned in Signed-off-by lines except
for self (use 'self' for that).
+- 'signatures' will avoid including anyone mentioned in any "<foo>-by:" lines.
- 'cccmd' will avoid running the --cc-cmd.
-- 'body' is equivalent to 'sob' + 'bodycc'
+- 'body' is equivalent to 'sob' + 'bodycc + signatures'
- 'all' will suppress all auto cc values.
--
+
diff --git a/git-send-email.perl b/git-send-email.perl
index d491db9..fc5bf41 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -75,7 +75,7 @@ git send-email [options] <file | directory | rev-list options >
--identity <str> * Use the sendemail.<id> options.
--to-cmd <str> * Email To: via `<str> \$patch_path`
--cc-cmd <str> * Email Cc: via `<str> \$patch_path`
- --suppress-cc <str> * author, self, sob, cc, cccmd, body, bodycc, all.
+ --suppress-cc <str> * author, self, sob, cc, cccmd, body, bodycc, signatures, all.
--[no-]signed-off-by-cc * Send to Signed-off-by: addresses. Default on.
--[no-]suppress-from * Send to self. Default off.
--[no-]chain-reply-to * Chain In-Reply-To: fields. Default off.
@@ -393,13 +393,13 @@ my(%suppress_cc);
if (@suppress_cc) {
foreach my $entry (@suppress_cc) {
die "Unknown --suppress-cc field: '$entry'\n"
- unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;
+ unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|signatures)$/;
$suppress_cc{$entry} = 1;
}
}
if ($suppress_cc{'all'}) {
- foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
+ foreach my $entry (qw (cccmd cc author self sob body bodycc signatures)) {
$suppress_cc{$entry} = 1;
}
delete $suppress_cc{'all'};
@@ -410,7 +410,7 @@ $suppress_cc{'self'} = $suppress_from if defined $suppress_from;
$suppress_cc{'sob'} = !$signed_off_by_cc if defined $signed_off_by_cc;
if ($suppress_cc{'body'}) {
- foreach my $entry (qw (sob bodycc)) {
+ foreach my $entry (qw (sob bodycc signatures)) {
$suppress_cc{$entry} = 1;
}
delete $suppress_cc{'body'};
@@ -1276,7 +1276,7 @@ foreach my $t (@files) {
# Now parse the message body
while(<$fh>) {
$message .= $_;
- if (/^(Signed-off-by|Cc): (.*)$/i) {
+ if (/^(Signed-off-by|Cc|[a-z_-]+by): (.*)$/i) {
chomp;
my ($what, $c) = ($1, $2);
chomp $c;
@@ -1285,6 +1285,7 @@ foreach my $t (@files) {
} else {
next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;
next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
+ next if $suppress_cc{'signatures'} and $what =~ /by$/i;
}
push @cc, $c;
printf("(body) Adding cc: %s from line '%s'\n",
--
1.7.8.dirty
next prev parent reply other threads:[~2011-12-08 2:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-29 1:34 [PATCH] git-send-email: Add auto-cc to all body signatures Joe Perches
2011-07-29 1:43 ` Jeff Kirsher
2011-12-08 2:58 ` Joe Perches [this message]
2011-12-08 19:37 ` Junio C Hamano
2011-12-08 20:51 ` Joe Perches
2015-12-02 10:04 ` Rasmus Villemoes
2015-12-02 17:00 ` [PATCH V3] " Joe Perches
2015-12-02 17:58 ` Junio C Hamano
2015-12-02 18:20 ` Joe Perches
2015-12-02 18:28 ` Joe Perches
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323313119.1762.58.camel@joe2Laptop \
--to=joe@perches.com \
--cc=git@vger.kernel.org \
--cc=jeffrey.t.kirsher@intel.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).