From: Nickolai Zeldovich <nickolai@csail.mit.edu>
To: gitster@pobox.com
Cc: Nickolai Zeldovich <nickolai@csail.mit.edu>, git@vger.kernel.org
Subject: [PATCH] git-send-email: treat field names as case-independent
Date: Sun, 6 Jan 2013 20:34:58 -0500 [thread overview]
Message-ID: <1357522498-8086-1-git-send-email-nickolai@csail.mit.edu> (raw)
Field names like To:, Cc:, etc should be treated as case-independent;
use a case-insensitive regexp to match them as such. Previously,
git-send-email would send email messages with a lowercase "cc:" line in
the body without actually sending a copy of the message to that address.
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
---
git-send-email.perl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 94c7f76..be809e5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1285,10 +1285,10 @@ foreach my $t (@files) {
}
if (defined $input_format && $input_format eq 'mbox') {
- if (/^Subject:\s+(.*)$/) {
+ if (/^Subject:\s+(.*)$/i) {
$subject = $1;
}
- elsif (/^From:\s+(.*)$/) {
+ elsif (/^From:\s+(.*)$/i) {
($author, $author_encoding) = unquote_rfc2047($1);
next if $suppress_cc{'author'};
next if $suppress_cc{'self'} and $author eq $sender;
@@ -1296,14 +1296,14 @@ foreach my $t (@files) {
$1, $_) unless $quiet;
push @cc, $1;
}
- elsif (/^To:\s+(.*)$/) {
+ elsif (/^To:\s+(.*)$/i) {
foreach my $addr (parse_address_line($1)) {
printf("(mbox) Adding to: %s from line '%s'\n",
$addr, $_) unless $quiet;
push @to, $addr;
}
}
- elsif (/^Cc:\s+(.*)$/) {
+ elsif (/^Cc:\s+(.*)$/i) {
foreach my $addr (parse_address_line($1)) {
if (unquote_rfc2047($addr) eq $sender) {
next if ($suppress_cc{'self'});
@@ -1325,7 +1325,7 @@ foreach my $t (@files) {
elsif (/^Message-Id: (.*)/i) {
$message_id = $1;
}
- elsif (!/^Date:\s/ && /^[-A-Za-z]+:\s+\S/) {
+ elsif (!/^Date:\s/i && /^[-A-Za-z]+:\s+\S/) {
push @xh, $_;
}
--
1.7.10.4
next reply other threads:[~2013-01-07 2:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-07 1:34 Nickolai Zeldovich [this message]
2013-01-07 3:27 ` [PATCH] git-send-email: treat field names as case-independent Junio C Hamano
2013-01-07 3:38 ` Nickolai Zeldovich
2013-01-07 7:47 ` Junio C Hamano
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=1357522498-8086-1-git-send-email-nickolai@csail.mit.edu \
--to=nickolai@csail.mit.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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;
as well as URLs for NNTP newsgroup(s).