rename_ref(): only print a warning when config-file update fails
[gitweb.git] / git-send-email.perl
index a71a192e4d752b7d79493321df5f82fbdd682dc7..1278fcba462f632a3687742f74cc15c0498874e2 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.
@@ -149,6 +149,16 @@ sub format_2822_time {
        $term = new FakeTerm "$@: going non-interactive";
 }
 
+my $def_chain = $repo->config_boolean('sendemail.chainreplyto');
+if ($def_chain and $def_chain eq 'false') {
+    $chain_reply_to = 0;
+}
+
+@bcclist = $repo->config('sendemail.bcc');
+if (!@bcclist or !$bcclist[0]) {
+    @bcclist = ();
+}
+
 # Begin by accumulating all the variables (defined above), that we will end up
 # needing, first, from the command line:
 
@@ -562,8 +572,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",
@@ -585,7 +595,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";
                }