rebase -i: call editor just once for a multi-squash
[gitweb.git] / git-send-email.perl
index 7552caca4bbbb38b161cfb47f94d4577627ccbb3..a09b1c96509e2587966fd2b1c5691e216f56ba8b 100755 (executable)
@@ -49,8 +49,8 @@ sub usage {
    --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
@@ -341,8 +341,7 @@ sub expand_aliases {
 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")