Merge branch 'bs/sendemail-tighten-anything-by'
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)
The recently added feature to add addresses that are on
anything-by: trailers in 'git send-email' was found to be way too
eager and considered nonsense strings as if they can be legitimate
beginning of *-by: trailer. This has been tightened.

* bs/sendemail-tighten-anything-by:
send-email: don't cc *-by lines with '-' prefix

1  2 
git-send-email.perl
diff --combined git-send-email.perl
index 751cabf47906f43aa49214cdd86725c882dae871,62c8f91d264f1edfeb09cc0d0d6eafe29c3e47a7..24859a7bc37b05909cf16554c102cadc842c13ff
@@@ -1699,7 -1699,7 +1699,7 @@@ sub process_file 
        # Now parse the message body
        while(<$fh>) {
                $message .=  $_;
-               if (/^([a-z-]*-by|Cc): (.*)/i) {
+               if (/^([a-z][a-z-]*-by|Cc): (.*)/i) {
                        chomp;
                        my ($what, $c) = ($1, $2);
                        # strip garbage for the address we'll use:
@@@ -1872,7 -1872,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")