Merge branch 'jc/send-email' into next

* jc/send-email:
  Make git-send-email detect mbox-style patches more readily
  git-send-email: real name with period need to be dq-quoted on From: line
This commit is contained in:
Junio C Hamano
2006-10-07 23:40:13 -07:00

View File

@@ -409,6 +409,11 @@ sub send_message
$gitversion = Git::version();
}
my ($author_name) = ($from =~ /^(.*?)\s+</);
if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
$from = "\"$name\"$addr";
}
my $header = "From: $from
To: $to
Cc: $cc
@@ -476,15 +481,21 @@ foreach my $t (@files) {
my $author_not_sender = undef;
@cc = @initial_cc;
@xh = ();
my $found_mbox = 0;
my $input_format = undef;
my $header_done = 0;
$message = "";
while(<F>) {
if (!$header_done) {
$found_mbox = 1, next if (/^From /);
if (/^From /) {
$input_format = 'mbox';
next;
}
chomp;
if (!defined $input_format && /^[-A-Za-z]+:\s/) {
$input_format = 'mbox';
}
if ($found_mbox) {
if (defined $input_format && $input_format eq 'mbox') {
if (/^Subject:\s+(.*)$/) {
$subject = $1;
@@ -509,6 +520,7 @@ foreach my $t (@files) {
# line 1 = cc
# line 2 = subject
# So let's support that, too.
$input_format = 'lots';
if (@cc == 0) {
printf("(non-mbox) Adding cc: %s from line '%s'\n",
$_, $_) unless $quiet;