Merge branch 'bc/send-email-qp-cr'
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Apr 2019 07:41:25 +0000 (16:41 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Apr 2019 07:41:25 +0000 (16:41 +0900)
"git send-email" has been taught to use quoted-printable when the
payload contains carriage-return. The use of the mechanism is in
line with the design originally added the codepath that chooses QP
when the payload has overly long lines.

* bc/send-email-qp-cr:
send-email: default to quoted-printable when CR is present

1  2 
git-send-email.perl
diff --combined git-send-email.perl
index 8200d58cdc62b628f77923305ecb79ff260155ea,3f66e1cdc216dec39ff52bef2e2520ea8b2959e2..751cabf47906f43aa49214cdd86725c882dae871
@@@ -465,8 -465,6 +465,8 @@@ $smtp_encryption = '' unless (defined $
  my(%suppress_cc);
  if (@suppress_cc) {
        foreach my $entry (@suppress_cc) {
 +              # Please update $__git_send_email_suppresscc_options
 +              # in git-completion.bash when you add new options.
                die sprintf(__("Unknown --suppress-cc field: '%s'\n"), $entry)
                        unless $entry =~ /^(?:all|cccmd|cc|author|self|sob|body|bodycc|misc-by)$/;
                $suppress_cc{$entry} = 1;
@@@ -496,8 -494,6 +496,8 @@@ my $confirm_unconfigured = !defined $co
  if ($confirm_unconfigured) {
        $confirm = scalar %suppress_cc ? 'compose' : 'auto';
  };
 +# Please update $__git_send_email_confirm_options in
 +# git-completion.bash when you add new options.
  die sprintf(__("Unknown --confirm setting: '%s'\n"), $confirm)
        unless $confirm =~ /^(?:auto|cc|compose|always|never)/;
  
@@@ -591,8 -587,6 +591,8 @@@ my %parse_alias = 
                if (/\(define-mail-alias\s+"(\S+?)"\s+"(\S+?)"\)/) {
                        $aliases{$1} = [ $2 ];
                }}}
 +      # Please update _git_config() in git-completion.bash when you
 +      # add new MUAs.
  );
  
  if (@alias_files and $aliasfiletype and defined $parse_alias{$aliasfiletype}) {
@@@ -1872,7 -1866,7 +1872,7 @@@ sub apply_transfer_encoding 
        $message = MIME::Base64::decode($message)
                if ($from eq 'base64');
  
-       $to = ($message =~ /.{999,}/) ? 'quoted-printable' : '8bit'
+       $to = ($message =~ /(?:.{999,}|\r)/) ? 'quoted-printable' : '8bit'
                if $to eq 'auto';
  
        die __("cannot send message as 7bit")