Merge branch 'sb/send-email-reconfirm-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Sat, 15 Sep 2012 04:32:07 +0000 (21:32 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 15 Sep 2012 04:32:07 +0000 (21:32 -0700)
* sb/send-email-reconfirm-fix:
send-email: initial_to and initial_reply_to are both optional

1  2 
git-send-email.perl
diff --combined git-send-email.perl
index 607137b9aaf5e3ea1a7f7f8e4b412afae2f2c320,b1fb7e615f309da5771927a8e9ab4e61ad8f5f59..aea66a0d47a9ad64fe805351c631fe5fddbf6182
@@@ -759,7 -759,8 +759,8 @@@ if (!defined $sender) 
  }
  
  if (!@initial_to && !defined $to_cmd) {
-       my $to = ask("Who should the emails be sent to? ",
+       my $to = ask("Who should the emails be sent to (if any)? ",
+                    default => "",
                     valid_re => qr/\@.*\./, confirm_only => 1);
        push @initial_to, parse_address_line($to) if defined $to; # sanitized/validated later
        $prompting++;
@@@ -786,7 -787,8 +787,8 @@@ sub expand_one_alias 
  
  if ($thread && !defined $initial_reply_to && $prompting) {
        $initial_reply_to = ask(
-               "Message-ID to be used as In-Reply-To for the first email? ",
+               "Message-ID to be used as In-Reply-To for the first email (if any)? ",
+               default => "",
                valid_re => qr/\@.*\./, confirm_only => 1);
  }
  if (defined $initial_reply_to) {
@@@ -872,13 -874,11 +874,13 @@@ $time = time - scalar $#files
  sub unquote_rfc2047 {
        local ($_) = @_;
        my $encoding;
 -      if (s/=\?([^?]+)\?q\?(.*)\?=/$2/g) {
 +      s{=\?([^?]+)\?q\?(.*?)\?=}{
                $encoding = $1;
 -              s/_/ /g;
 -              s/=([0-9A-F]{2})/chr(hex($1))/eg;
 -      }
 +              my $e = $2;
 +              $e =~ s/_/ /g;
 +              $e =~ s/=([0-9A-F]{2})/chr(hex($1))/eg;
 +              $e;
 +      }eg;
        return wantarray ? ($_, $encoding) : $_;
  }