Merge branch 'po/sendemail'
authorJunio C Hamano <gitster@pobox.com>
Wed, 27 Oct 2010 04:37:54 +0000 (21:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Oct 2010 04:37:54 +0000 (21:37 -0700)
* po/sendemail:
New send-email option smtpserveroption.
Remove @smtp_host_parts variable as not used.
Minor indentation fix.

1  2 
Documentation/config.txt
git-send-email.perl
diff --combined Documentation/config.txt
index ba9639c7bd5050a7f540e6d85257aa83bf6062ae,bb8db24c6fb048d15f168f6ca8d4fa918efd39a9..538ebb5e2ecc58f1ddcb7adb44ded3b027555ec2
@@@ -450,21 -450,6 +450,21 @@@ core.excludesfile:
        to the value of `$HOME` and "{tilde}user/" to the specified user's
        home directory.  See linkgit:gitignore[5].
  
 +core.askpass::
 +      Some commands (e.g. svn and http interfaces) that interactively
 +      ask for a password can be told to use an external program given
 +      via the value of this variable. Can be overridden by the 'GIT_ASKPASS'
 +      environment variable. If not set, fall back to the value of the
 +      'SSH_ASKPASS' environment variable or, failing that, a simple password
 +      prompt. The external program shall be given a suitable prompt as
 +      command line argument and write the password on its STDOUT.
 +
 +core.attributesfile::
 +      In addition to '.gitattributes' (per-directory) and
 +      '.git/info/attributes', git looks into this file for attributes
 +      (see linkgit:gitattributes[5]). Path expansions are made the same
 +      way as for `core.excludesfile`.
 +
  core.editor::
        Commands such as `commit` and `tag` that lets you edit
        messages by launching an editor uses the value of this
@@@ -819,6 -804,8 +819,6 @@@ diff.mnemonicprefix:
        standard "a/" and "b/" depending on what is being compared.  When
        this configuration is in effect, reverse diff output also swaps
        the order of the prefixes:
 -diff.noprefix::
 -      If set, 'git diff' does not show any source or destination prefix.
  `git diff`;;
        compares the (i)ndex and the (w)ork tree;
  `git diff HEAD`;;
  `git diff --no-index a b`;;
        compares two non-git things (1) and (2).
  
 +diff.noprefix::
 +      If set, 'git diff' does not show any source or destination prefix.
 +
  diff.renameLimit::
        The number of files to consider when performing the copy/rename
        detection; equivalent to the 'git diff' option '-l'.
@@@ -1472,10 -1456,6 +1472,10 @@@ pack.compression:
        not set,  defaults to -1, the zlib default, which is "a default
        compromise between speed and compression (currently equivalent
        to level 6)."
 ++
 +Note that changing the compression level will not automatically recompress
 +all existing objects. You can force recompression by passing the -F option
 +to linkgit:git-repack[1].
  
  pack.deltaCacheSize::
        The maximum memory in bytes used for caching deltas in
@@@ -1560,12 -1540,12 +1560,12 @@@ push.default:
        no refspec is implied by any of the options given on the command
        line. Possible values are:
  +
 -* `nothing` do not push anything.
 -* `matching` push all matching branches.
 +* `nothing` do not push anything.
 +* `matching` push all matching branches.
    All branches having the same name in both ends are considered to be
    matching. This is the default.
 -* `tracking` push the current branch to its upstream branch.
 -* `current` push the current branch to a branch of the same name.
 +* `tracking` push the current branch to its upstream branch.
 +* `current` push the current branch to a branch of the same name.
  
  rebase.stat::
        Whether to show a diffstat of what changed upstream since the last
@@@ -1737,6 -1717,7 +1737,7 @@@ sendemail.to:
  sendemail.smtpdomain::
  sendemail.smtpserver::
  sendemail.smtpserverport::
+ sendemail.smtpserveroption::
  sendemail.smtpuser::
  sendemail.thread::
  sendemail.validate::
@@@ -1765,9 -1746,9 +1766,9 @@@ status.showUntrackedFiles:
        the untracked files. Possible values are:
  +
  --
 -      - 'no'     - Show no untracked files
 -      - 'normal' - Shows untracked files and directories
 -      - 'all'    - Shows also individual files in untracked directories.
 +* `no` - Show no untracked files.
 +* `normal` - Show untracked files and directories.
 +* `all` - Show also individual files in untracked directories.
  --
  +
  If this variable is not specified, it defaults to 'normal'.
diff --combined git-send-email.perl
index 8cc416115569e38317e63d1638d361d579518b73,47989fe6dd1d2bb7d477a60a989805cb769d2a3c..458e86afdedfbad45f12ec1910735c617ffbe8c7
@@@ -24,7 -24,6 +24,7 @@@ use Text::ParseWords
  use Data::Dumper;
  use Term::ANSIColor;
  use File::Temp qw/ tempdir tempfile /;
 +use File::Spec::Functions qw(catfile);
  use Error qw(:try);
  use Git;
  
@@@ -61,6 -60,7 +61,7 @@@ git send-email [options] <file | direct
      --envelope-sender       <str>  * Email envelope sender.
      --smtp-server       <str:int>  * Outgoing SMTP server to use. The port
                                       is optional. Default 'localhost'.
+     --smtp-server-option    <str>  * Outgoing SMTP server option to use.
      --smtp-server-port      <int>  * Outgoing SMTP server port.
      --smtp-user             <str>  * Username for SMTP-AUTH.
      --smtp-pass             <str>  * Password for SMTP-AUTH; not necessary.
@@@ -86,7 -86,6 +87,7 @@@
      --[no-]validate                * Perform patch sanity checks. Default on.
      --[no-]format-patch            * understand any non optional arguments as
                                       `git format-patch` ones.
 +    --force                        * Send even if safety checks would prevent it.
  
  EOT
        exit(1);
@@@ -164,7 -163,6 +165,7 @@@ if ($@) 
  my ($quiet, $dry_run) = (0, 0);
  my $format_patch;
  my $compose_filename;
 +my $force = 0;
  
  # Handle interactive edition of files.
  my $multiedit;
@@@ -191,8 -189,9 +192,9 @@@ sub do_edit 
  
  # Variables with corresponding config settings
  my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);
- my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
- my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts, $smtp_domain);
+ my ($smtp_server, $smtp_server_port, @smtp_server_options);
+ my ($smtp_authuser, $smtp_encryption);
+ my ($identity, $aliasfiletype, @alias_files, $smtp_domain);
  my ($validate, $confirm);
  my (@suppress_cc);
  my ($auto_8bit_encoding);
@@@ -213,9 -212,10 +215,10 @@@ my %config_bool_settings = 
  my %config_settings = (
      "smtpserver" => \$smtp_server,
      "smtpserverport" => \$smtp_server_port,
+     "smtpserveroption" => \@smtp_server_options,
      "smtpuser" => \$smtp_authuser,
      "smtppass" => \$smtp_authpass,
-       "smtpdomain" => \$smtp_domain,
+     "smtpdomain" => \$smtp_domain,
      "to" => \@to,
      "cc" => \@initial_cc,
      "cccmd" => \$cc_cmd,
@@@ -282,6 -282,7 +285,7 @@@ my $rc = GetOptions("sender|from=s" => 
                    "no-bcc" => \$no_bcc,
                    "chain-reply-to!" => \$chain_reply_to,
                    "smtp-server=s" => \$smtp_server,
+                   "smtp-server-option=s" => \@smtp_server_options,
                    "smtp-server-port=s" => \$smtp_server_port,
                    "smtp-user=s" => \$smtp_authuser,
                    "smtp-pass:s" => \$smtp_authpass,
                    "validate!" => \$validate,
                    "format-patch!" => \$format_patch,
                    "8bit-encoding=s" => \$auto_8bit_encoding,
 +                  "force" => \$force,
         );
  
  unless ($rc) {
@@@ -515,7 -515,7 +519,7 @@@ while (defined(my $f = shift @ARGV)) 
                opendir(DH,$f)
                        or die "Failed to opendir $f: $!";
  
 -              push @files, grep { -f $_ } map { +$f . "/" . $_ }
 +              push @files, grep { -f $_ } map { catfile($f, $_) }
                                sort readdir(DH);
                closedir(DH);
        } elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
@@@ -706,16 -706,6 +710,16 @@@ if (!defined $auto_8bit_encoding && sca
                                  default => "UTF-8");
  }
  
 +if (!$force) {
 +      for my $f (@files) {
 +              if (get_patch_subject($f) =~ /\*\*\* SUBJECT HERE \*\*\*/) {
 +                      die "Refusing to send because the patch\n\t$f\n"
 +                              . "has the template subject '*** SUBJECT HERE ***'. "
 +                              . "Pass --force if you really want to send.\n";
 +              }
 +      }
 +}
 +
  my $prompting = 0;
  if (!defined $sender) {
        $sender = $repoauthor || $repocommitter || '';
@@@ -909,7 -899,7 +913,7 @@@ sub sanitize_address 
  
  sub valid_fqdn {
        my $domain = shift;
 -      return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
 +      return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
  }
  
  sub maildomain_net {
@@@ -1029,6 -1019,8 +1033,8 @@@ X-Mailer: git-send-email $gitversio
                }
        }
  
+       unshift (@sendmail_parameters, @smtp_server_options);
        if ($dry_run) {
                # We don't want to send the email.
        } elsif ($smtp_server =~ m#^/#) {