summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorKrzysztof Mazur <krzysiek@podlesie.net>2012-10-10 01:02:56 +0200
committerJunio C Hamano <gitster@pobox.com>2012-10-10 00:33:40 -0700
commit62e0069056ed11294c29bae25df69b6518f6339e (patch)
tree3bd80750f09d38d7b3d7349609d4ff352e87c22a /git-send-email.perl
parentdc01f880a53e56d4a5c6f30cb2d7b9412e17bfe7 (diff)
downloadgit-62e0069056ed11294c29bae25df69b6518f6339e.tar.gz
git-send-email: introduce compose-encoding
The introduction email (--compose option) have encoding hardcoded to UTF-8, but invoked editor may not use UTF-8 encoding. The encoding used by patches can be changed by the "8bit-encoding" option, but this option does not have effect on introduction email and equivalent for introduction email is missing. Added compose-encoding command line option and sendemail.composeencoding configuration option specify encoding of introduction email. Signed-off-by: Krzysztof Mazur <krzysiek@podlesie.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index aea66a0d47..107e814b67 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -56,6 +56,7 @@ git send-email [options] <file | directory | rev-list options >
--in-reply-to <str> * Email "In-Reply-To:"
--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.
--8bit-encoding <str> * Encoding to assume 8bit mails if undeclared
Sending:
@@ -198,6 +199,7 @@ my ($identity, $aliasfiletype, @alias_files, $smtp_domain);
my ($validate, $confirm);
my (@suppress_cc);
my ($auto_8bit_encoding);
+my ($compose_encoding);
my ($debug_net_smtp) = 0; # Net::SMTP, see send_message()
@@ -231,6 +233,7 @@ my %config_settings = (
"confirm" => \$confirm,
"from" => \$sender,
"assume8bitencoding" => \$auto_8bit_encoding,
+ "composeencoding" => \$compose_encoding,
);
my %config_path_settings = (
@@ -315,6 +318,7 @@ my $rc = GetOptions("h" => \$help,
"validate!" => \$validate,
"format-patch!" => \$format_patch,
"8bit-encoding=s" => \$auto_8bit_encoding,
+ "compose-encoding=s" => \$compose_encoding,
"force" => \$force,
);
@@ -638,10 +642,13 @@ EOT
$summary_empty = 0 unless (/^\n$/);
} elsif (/^\n$/) {
$in_body = 1;
+ if (!defined $compose_encoding) {
+ $compose_encoding = "UTF-8";
+ }
if ($need_8bit_cte) {
print $c2 "MIME-Version: 1.0\n",
"Content-Type: text/plain; ",
- "charset=UTF-8\n",
+ "charset=$compose_encoding\n",
"Content-Transfer-Encoding: 8bit\n";
}
} elsif (/^MIME-Version:/i) {