Code

user-manual: update for new default --track behavior
[git.git] / git-send-email.perl
index 87f59fa313f4483dc15846979e80e8a8aec3d1f5..f43f92f9579198dd092a09551a914da2c4c99b6e 100755 (executable)
@@ -49,8 +49,8 @@ Options:
    --bcc          Specify a list of email addresses that should be Bcc:
                  on all the emails.
 
-   --compose      Use \$EDITOR to edit an introductory message for the
-                  patch series.
+   --compose      Use \$GIT_EDITOR, core.editor, \$EDITOR, or \$VISUAL to edit
+                 an introductory message for the patch series.
 
    --subject      Specify the initial "Subject:" line.
                   Only necessary if --compose is also set.  If --compose
@@ -237,7 +237,7 @@ my %parse_alias = (
                        $aliases{$1} = [ split(/\s+/, $2) ];
                }}},
        pine => sub { my $fh = shift; while (<$fh>) {
-               if (/^(\S+)\s+(.*)$/) {
+               if (/^(\S+)\t.*\t(.*)$/) {
                        $aliases{$1} = [ split(/\s*,\s*/, $2) ];
                }}},
        gnus => sub { my $fh = shift; while (<$fh>) {
@@ -254,6 +254,8 @@ if (@alias_files and $aliasfiletype and defined $parse_alias{$aliasfiletype}) {
        }
 }
 
+($from) = expand_aliases($from) if defined $from;
+
 my $prompting = 0;
 if (!defined $from) {
        $from = $author || $committer;
@@ -339,8 +341,7 @@ GIT: for the patch you are writing.
 EOT
        close(C);
 
-       my $editor = $ENV{EDITOR};
-       $editor = 'vi' unless defined $editor;
+       my $editor = $ENV{GIT_EDITOR} || $repo->config("core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
        system($editor, $compose_filename);
 
        open(C2,">",$compose_filename . ".final")
@@ -408,6 +409,7 @@ sub extract_valid_address {
        return $address if ($address =~ /^($local_part_regexp)$/);
 
        if ($have_email_valid) {
+               $address =~ s/^\s*<(.*)>\s*$/$1/;
                return scalar Email::Valid->address($address);
        } else {
                # less robust/correct than the monster regexp in Email::Valid,