]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-send-email.perl
GIT-VERSION-FILE: check ./version first.
[thirdparty/git.git] / git-send-email.perl
index 4c87c20c158fe3edfd0b770f1855e67e20038e3b..6a285bfd214132f792f7493433a52019ba80b5ab 100755 (executable)
@@ -178,11 +178,10 @@ my $prompting = 0;
 if (!defined $from) {
        $from = $author || $committer;
        do {
-               $_ = $term->readline("Who should the emails appear to be from? ",
-                       $from);
+               $_ = $term->readline("Who should the emails appear to be from? [$from] ");
        } while (!defined $_);
 
-       $from = $_;
+       $from = $_ if ($_);
        print "Emails will be sent from: ", $from, "\n";
        $prompting++;
 }
@@ -403,6 +402,15 @@ sub make_message_id
 $cc = "";
 $time = time - scalar $#files;
 
+sub unquote_rfc2047 {
+       local ($_) = @_;
+       if (s/=\?utf-8\?q\?(.*)\?=/$1/g) {
+               s/_/ /g;
+               s/=([0-9A-F]{2})/chr(hex($1))/eg;
+       }
+       return "$_";
+}
+
 sub send_message
 {
        my @recipients = unique_email_list(@to);
@@ -556,6 +564,7 @@ foreach my $t (@files) {
        }
        close F;
        if (defined $author_not_sender) {
+               $author_not_sender = unquote_rfc2047($author_not_sender);
                $message = "From: $author_not_sender\n\n$message";
        }