summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorNanako Shiraishi <nanako3@lavabit.com>2009-11-29 03:24:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-29 08:51:35 (GMT)
commit528fb08732aa742edf56bc61cc8943c7f6d02977 (patch)
tree2bb0fbde405bb90e544732d3fd1a5d43e2daf4ee /git-send-email.perl
parent66abce05dd5b9da9c889034781dc3de38b6e231b (diff)
downloadgit-528fb08732aa742edf56bc61cc8943c7f6d02977.zip
git-528fb08732aa742edf56bc61cc8943c7f6d02977.tar.gz
git-528fb08732aa742edf56bc61cc8943c7f6d02977.tar.bz2
prepare send-email for smoother change of --chain-reply-to default
Give a warning message when send-email uses chain-reply-to to thread the messages because of the current default, not because the user explicitly asked to, either from the command line or from the configuration. This way, by the time 1.7.0 switches the default, everybody will be ready. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-xgit-send-email.perl19
1 files changed, 17 insertions, 2 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 4f5da4e..6bd4bbc 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -187,9 +187,11 @@ my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
my ($validate, $confirm);
my (@suppress_cc);
+my $not_set_by_user = "true but not set by the user";
+
my %config_bool_settings = (
"thread" => [\$thread, 1],
- "chainreplyto" => [\$chain_reply_to, 1],
+ "chainreplyto" => [\$chain_reply_to, $not_set_by_user],
"suppressfrom" => [\$suppress_from, undef],
"signedoffbycc" => [\$signed_off_by_cc, undef],
"signedoffcc" => [\$signed_off_by_cc, undef], # Deprecated
@@ -214,6 +216,19 @@ my %config_settings = (
"from" => \$sender,
);
+# Help users prepare for 1.7.0
+sub chain_reply_to {
+ if (defined $chain_reply_to &&
+ $chain_reply_to eq $not_set_by_user) {
+ print STDERR
+ "In git 1.7.0, the default will be changed to --no-chain-reply-to\n" .
+ "Set sendemail.chainreplyto configuration variable to true if\n" .
+ "you want to keep --chain-reply-to as your default.\n";
+ $chain_reply_to = 1;
+ }
+ return $chain_reply_to;
+}
+
# Handle Uncouth Termination
sub signal_handler {
@@ -1157,7 +1172,7 @@ foreach my $t (@files) {
# set up for the next message
if ($thread && $message_was_sent &&
- ($chain_reply_to || !defined $reply_to || length($reply_to) == 0)) {
+ (chain_reply_to() || !defined $reply_to || length($reply_to) == 0)) {
$reply_to = $message_id;
if (length $references > 0) {
$references .= "\n $message_id";