summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-01-07 13:07:27 -0800
committerJunio C Hamano <gitster@pobox.com>2015-01-07 13:07:27 -0800
commit5095fa61e38c92cbc8c603880f04f0d6127ae72e (patch)
tree30a2f235d0e73ee3c7e1dac76b1c3d20c30923a0 /git-send-email.perl
parent948e81408d29be0d39b55d5da41a6c7c9b93fbc0 (diff)
parent2cf770f50185fc7a1e3aaa0463eb452d32517f83 (diff)
downloadgit-5095fa61e38c92cbc8c603880f04f0d6127ae72e.tar.gz
Merge branch 'lh/send-email-hide-x-mailer'
"git send-email" normally identifies itself via X-Mailer: header in the message it sends out. A new command line flag allows the user to squelch the header. * lh/send-email-hide-x-mailer: test/send-email: --[no-]xmailer tests send-email: add --[no-]xmailer option
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl11
1 files changed, 8 insertions, 3 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 58c8bc2a59..3092ab356c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -54,6 +54,7 @@ git send-email [options] <file | directory | rev-list options >
--[no-]bcc <str> * Email Bcc:
--subject <str> * Email "Subject:"
--in-reply-to <str> * Email "In-Reply-To:"
+ --[no-]xmailer * Add "X-Mailer:" header (default).
--[no-]annotate * Review each patch that will be sent in an editor.
--compose * Open an editor for introduction.
--compose-encoding <str> * Encoding to assume for introduction.
@@ -154,7 +155,7 @@ my $re_encoded_word = qr/=\?($re_token)\?($re_token)\?($re_encoded_text)\?=/;
# Variables we fill in automatically, or via prompting:
my (@to,$no_to,@initial_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,
$initial_reply_to,$initial_subject,@files,
- $author,$sender,$smtp_authpass,$annotate,$compose,$time);
+ $author,$sender,$smtp_authpass,$annotate,$use_xmailer,$compose,$time);
my $envelope_sender;
@@ -226,7 +227,8 @@ my %config_bool_settings = (
"signedoffcc" => [\$signed_off_by_cc, undef], # Deprecated
"validate" => [\$validate, 1],
"multiedit" => [\$multiedit, undef],
- "annotate" => [\$annotate, undef]
+ "annotate" => [\$annotate, undef],
+ "xmailer" => [\$use_xmailer, 1]
);
my %config_settings = (
@@ -327,6 +329,7 @@ my $rc = GetOptions("h" => \$help,
"8bit-encoding=s" => \$auto_8bit_encoding,
"compose-encoding=s" => \$compose_encoding,
"force" => \$force,
+ "xmailer!" => \$use_xmailer,
);
usage() if $help;
@@ -1181,8 +1184,10 @@ To: $to${ccline}
Subject: $subject
Date: $date
Message-Id: $message_id
-X-Mailer: git-send-email $gitversion
";
+ if ($use_xmailer) {
+ $header .= "X-Mailer: git-send-email $gitversion\n";
+ }
if ($reply_to) {
$header .= "In-Reply-To: $reply_to\n";