Code

mergetools: use the correct tool for Beyond Compare 3 on Windows
[git.git] / git-send-email.perl
index f17f7b3995c833d0434a258e18f6aa2d5568637e..6885dfa1b9b4448a2a75583abcc25ff14a887044 100755 (executable)
@@ -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,
@@ -316,6 +318,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
                    "force" => \$force,
         );
 
+usage() if $help;
 unless ($rc) {
     usage();
 }
@@ -334,8 +337,16 @@ sub read_config {
        }
 
        foreach my $setting (keys %config_path_settings) {
-               my $target = $config_path_settings{$setting}->[0];
-               $$target = Git::config_path(@repo, "$prefix.$setting") unless (defined $$target);
+               my $target = $config_path_settings{$setting};
+               if (ref($target) eq "ARRAY") {
+                       unless (@$target) {
+                               my @values = Git::config_path(@repo, "$prefix.$setting");
+                               @$target = @values if (@values && defined $values[0]);
+                       }
+               }
+               else {
+                       $$target = Git::config_path(@repo, "$prefix.$setting") unless (defined $$target);
+               }
        }
 
        foreach my $setting (keys %config_settings) {
@@ -1103,6 +1114,12 @@ X-Mailer: git-send-email $gitversion
                }
 
                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) {