From: Junio C Hamano Date: Fri, 4 Dec 2015 19:19:10 +0000 (-0800) Subject: Merge branch 'jk/send-email-complete-aliases' X-Git-Tag: v2.7.0-rc0~16 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c69d08df96ab784a61c9abaf81a632eea594e62b?ds=inline;hp=-c Merge branch 'jk/send-email-complete-aliases' Teach send-email to dump mail aliases, so that we can do tab completion on the command line. * jk/send-email-complete-aliases: completion: add support for completing email aliases sendemail: teach git-send-email to dump alias names --- c69d08df96ab784a61c9abaf81a632eea594e62b diff --combined git-send-email.perl index 77cc2cc371,a475b0d753..2a3873b744 --- a/git-send-email.perl +++ b/git-send-email.perl @@@ -46,6 -46,7 +46,7 @@@ package main sub usage { print < + git send-email --dump-aliases Composing: --from * Email From: @@@ -101,6 -102,9 +102,9 @@@ `git format-patch` ones. --force * Send even if safety checks would prevent it. + Information: + --dump-aliases * Dump configured aliases and exit. + EOT exit(1); } @@@ -180,6 -184,7 +184,7 @@@ my ($quiet, $dry_run) = (0, 0) my $format_patch; my $compose_filename; my $force = 0; + my $dump_aliases = 0; # Handle interactive edition of files. my $multiedit; @@@ -239,6 -244,7 +244,6 @@@ my %config_settings = "smtpserveroption" => \@smtp_server_options, "smtpuser" => \$smtp_authuser, "smtppass" => \$smtp_authpass, - "smtpsslcertpath" => \$smtp_ssl_cert_path, "smtpdomain" => \$smtp_domain, "smtpauth" => \$smtp_auth, "to" => \@initial_to, @@@ -258,7 -264,6 +263,7 @@@ my %config_path_settings = ( "aliasesfile" => \@alias_files, + "smtpsslcertpath" => \$smtp_ssl_cert_path, ); # Handle Uncouth Termination @@@ -291,6 -296,11 +296,11 @@@ $SIG{INT} = \&signal_handler my $help; my $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; + $rc = GetOptions( "sender|from=s" => \$sender, "in-reply-to=s" => \$initial_reply_to, "subject=s" => \$initial_subject, @@@ -551,6 -561,11 +561,11 @@@ if (@alias_files and $aliasfiletype an } } + if ($dump_aliases) { + print "$_\n" for (sort keys %aliases); + exit(0); + } + # is_format_patch_arg($f) returns 0 if $f names a patch, or 1 if # $f is a revision list specification to be passed to format-patch. sub is_format_patch_arg { @@@ -1196,7 -1211,8 +1211,7 @@@ sub ssl_verify_params return (SSL_verify_mode => SSL_VERIFY_PEER(), SSL_ca_file => $smtp_ssl_cert_path); } else { - print STDERR "Not using SSL_VERIFY_PEER because the CA path does not exist.\n"; - return (SSL_verify_mode => SSL_VERIFY_NONE()); + die "CA path \"$smtp_ssl_cert_path\" does not exist"; } }