Merge branch 'mk/diff'
[gitweb.git] / git-send-email.perl
index 6989c0260fcafe29397c89cfcc61a8ef9a49d58e..d6b15480dc1e211f0653ff54963889464dad3573 100755 (executable)
@@ -65,8 +65,8 @@ sub usage {
                   Defaults to on.
 
    --no-signed-off-cc Suppress the automatic addition of email addresses
-                 that appear in a Signed-off-by: line, to the cc: list.
-                Note: Using this option is not recommended.
+                 that appear in Signed-off-by: or Cc: lines to the cc:
+                 list.  Note: Using this option is not recommended.
 
    --smtp-server  If set, specifies the outgoing SMTP server to use.
                   Defaults to localhost.
@@ -446,9 +446,12 @@ sub send_message
                my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
                $from = "\"$name\"$addr";
        }
+       my $ccline = "";
+       if ($cc ne '') {
+               $ccline = "\nCc: $cc";
+       }
        my $header = "From: $from
-To: $to
-Cc: $cc
+To: $to${ccline}
 Subject: $subject
 Date: $date
 Message-Id: $message_id
@@ -572,8 +575,8 @@ sub send_message
                        }
                } else {
                        $message .=  $_;
-                       if (/^Signed-off-by: (.*)$/i && !$no_signed_off_cc) {
-                               my $c = $1;
+                       if (/^(Signed-off-by|Cc): (.*)$/i && !$no_signed_off_cc) {
+                               my $c = $2;
                                chomp $c;
                                push @cc, $c;
                                printf("(sob) Adding cc: %s from line '%s'\n",
@@ -595,7 +598,7 @@ sub send_message
        if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
                $reply_to = $message_id;
                if (length $references > 0) {
-                       $references .= " $message_id";
+                       $references .= "\n $message_id";
                } else {
                        $references = "$message_id";
                }