diff options
author | Adam Roben <aroben@apple.com> | 2007-06-26 15:48:30 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-26 22:22:06 -0700 |
commit | e46f7a0e1c641cd80affd80516677f1e370cd72c (patch) | |
tree | 57dac5bcb44df592fb2258dd7f18ce1c48354866 /git-send-email.perl | |
parent | 384f122b7c6dd2b52cc6029afee16560c38850ae (diff) | |
download | git-e46f7a0e1c641cd80affd80516677f1e370cd72c.tar.gz |
git-send-email: Add --threaded option
The --threaded option controls whether the In-Reply-To header will be set on
any emails sent. The current behavior is to always set this header, so this
option is most useful in its negated form, --no-threaded. This behavior can
also be controlled through the 'sendemail.threaded' config setting.
Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index 9f75551673..b8b8fe7ee3 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -74,6 +74,9 @@ Options: --suppress-from Suppress sending emails to yourself if your address appears in a From: line. + --threaded Specify that the "In-Reply-To:" header should be set on all + emails. Defaults to on. + --quiet Make git-send-email less verbose. One line per email should be all that is output. @@ -138,8 +141,8 @@ my (@to,@cc,@initial_cc,@bcclist,@xh, $initial_reply_to,$initial_subject,@files,$from,$compose,$time); # Behavior modification variables -my ($chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc, - $dry_run) = (1, 0, 0, 0, 0); +my ($threaded, $chain_reply_to, $quiet, $suppress_from, $no_signed_off_cc, + $dry_run) = (1, 1, 0, 0, 0, 0); my $smtp_server; my $envelope_sender; @@ -154,9 +157,16 @@ if ($@) { $term = new FakeTerm "$@: going non-interactive"; } -my $def_chain = $repo->config_bool('sendemail.chainreplyto'); -if (defined $def_chain and not $def_chain) { - $chain_reply_to = 0; +my %config_settings = ( + "threaded" => \$threaded, + "chainreplyto" => \$chain_reply_to, +); + +foreach my $setting (keys %config_settings) { + my $default = $repo->config_bool("sendemail.$setting"); + if (defined $default) { + $config_settings{$setting} = $default ? 1 : 0; + } } @bcclist = $repo->config('sendemail.bcc'); @@ -181,6 +191,7 @@ my $rc = GetOptions("from=s" => \$from, "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc, "dry-run" => \$dry_run, "envelope-sender=s" => \$envelope_sender, + "threaded!" => \$threaded, ); unless ($rc) { @@ -287,7 +298,7 @@ if (!defined $initial_subject && $compose) { $prompting++; } -if (!defined $initial_reply_to && $prompting) { +if ($threaded && !defined $initial_reply_to && $prompting) { do { $_= $term->readline("Message-ID to be used as In-Reply-To for the first email? ", $initial_reply_to); @@ -484,7 +495,7 @@ Date: $date Message-Id: $message_id X-Mailer: git-send-email $gitversion "; - if ($reply_to) { + if ($threaded && $reply_to) { $header .= "In-Reply-To: $reply_to\n"; $header .= "References: $references\n"; |