From: Junio C Hamano Date: Thu, 13 Jun 2019 20:18:46 +0000 (-0700) Subject: Merge branch 'ab/send-email-transferencoding-fix' X-Git-Tag: v2.23.0-rc0~143 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/86d2271f06382ceeb66e891eff87166d858270e1 Merge branch 'ab/send-email-transferencoding-fix' Since "git send-email" learned to take 'auto' as the value for the transfer-encoding, it by mistake stopped honoring the values given to the configuration variables sendemail.transferencoding and/or sendemail..transferencoding. This has been corrected to (finally) redoing the order of setting the default, reading the configuration and command line options. * ab/send-email-transferencoding-fix: send-email: fix regression in sendemail.identity parsing send-email: document --no-[to|cc|bcc] send-email: fix broken transferEncoding tests send-email: remove cargo-culted multi-patch pattern in tests send-email: do defaults -> config -> getopt in that order send-email: rename the @bcclist variable for consistency send-email: move the read_config() function above getopts --- 86d2271f06382ceeb66e891eff87166d858270e1 diff --cc git-send-email.perl index 24859a7bc3,474598339e..5f92c89c1c --- a/git-send-email.perl +++ b/git-send-email.perl @@@ -319,9 -393,8 +401,9 @@@ undef $identity if $no_identity # needing, first, from the command line: my $help; +my $git_completion_helper; - my $rc = GetOptions("h" => \$help, - "dump-aliases" => \$dump_aliases); + $rc = GetOptions("h" => \$help, + "dump-aliases" => \$dump_aliases); usage() unless $rc; die __("--dump-aliases incompatible with other options\n") if !$help and $dump_aliases and @ARGV; @@@ -350,8 -423,6 +432,7 @@@ $rc = GetOptions "smtp-debug:i" => \$debug_net_smtp, "smtp-domain:s" => \$smtp_domain, "smtp-auth=s" => \$smtp_auth, + "no-smtp-auth" => sub {$smtp_auth = 'none'}, - "identity=s" => \$identity, "annotate!" => \$annotate, "no-annotate" => sub {$annotate = 0}, "compose" => \$compose, @@@ -383,11 -454,14 +464,16 @@@ "no-xmailer" => sub {$use_xmailer = 0}, "batch-size=i" => \$batch_size, "relogin-delay=i" => \$relogin_delay, + "git-completion-helper" => \$git_completion_helper, ); + # Munge any "either config or getopt, not both" variables + my @initial_to = @getopt_to ? @getopt_to : ($no_to ? () : @config_to); + my @initial_cc = @getopt_cc ? @getopt_cc : ($no_cc ? () : @config_cc); + my @initial_bcc = @getopt_bcc ? @getopt_bcc : ($no_bcc ? () : @config_bcc); + usage() if $help; +completion_helper() if $git_completion_helper; unless ($rc) { usage(); }