Code

Merge branch 'cs/perl-config-path-send-email'
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Oct 2011 19:34:05 +0000 (12:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Oct 2011 19:34:05 +0000 (12:34 -0700)
* cs/perl-config-path-send-email:
  use new Git::config_path() for aliasesfile
  Add Git::config_path()

1  2 
git-send-email.perl

diff --combined git-send-email.perl
index 8ded7f5ce3556acf69a2d88e8b9aedae1d5e2da6,f17f7b3995c833d0434a258e18f6aa2d5568637e..91607c5878953d69a8e32731023b2eb727bcc069
@@@ -225,7 -225,6 +225,6 @@@ my %config_settings = 
      "cccmd" => \$cc_cmd,
      "aliasfiletype" => \$aliasfiletype,
      "bcc" => \@bcclist,
-     "aliasesfile" => \@alias_files,
      "suppresscc" => \@suppress_cc,
      "envelopesender" => \$envelope_sender,
      "multiedit" => \$multiedit,
      "assume8bitencoding" => \$auto_8bit_encoding,
  );
  
+ my %config_path_settings = (
+     "aliasesfile" => \@alias_files,
+ );
  # Help users prepare for 1.7.0
  sub chain_reply_to {
        if (defined $chain_reply_to &&
@@@ -275,9 -278,7 +278,9 @@@ $SIG{INT}  = \&signal_handler
  # Begin by accumulating all the variables (defined above), that we will end up
  # needing, first, from the command line:
  
 -my $rc = GetOptions("sender|from=s" => \$sender,
 +my $help;
 +my $rc = GetOptions("h" => \$help,
 +                  "sender|from=s" => \$sender,
                      "in-reply-to=s" => \$initial_reply_to,
                    "subject=s" => \$initial_subject,
                    "to=s" => \@initial_to,
                    "force" => \$force,
         );
  
 +usage() if $help;
  unless ($rc) {
      usage();
  }
@@@ -333,6 -333,11 +336,11 @@@ sub read_config 
                $$target = Git::config_bool(@repo, "$prefix.$setting") unless (defined $$target);
        }
  
+       foreach my $setting (keys %config_path_settings) {
+               my $target = $config_path_settings{$setting}->[0];
+               $$target = Git::config_path(@repo, "$prefix.$setting") unless (defined $$target);
+       }
        foreach my $setting (keys %config_settings) {
                my $target = $config_settings{$setting};
                next if $setting eq "to" and defined $no_to;
@@@ -1098,12 -1103,6 +1106,12 @@@ X-Mailer: git-send-email $gitversio
                }
  
                if (defined $smtp_authuser) {
 +                      # Workaround AUTH PLAIN/LOGIN interaction defect
 +                      # with Authen::SASL::Cyrus
 +                      eval {
 +                              require Authen::SASL;
 +                              Authen::SASL->import(qw(Perl));
 +                      };
  
                        if (!defined $smtp_authpass) {