diff options
author | Adam Roben <aroben@apple.com> | 2007-07-19 22:09:35 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-20 00:46:34 -0700 |
commit | ef0c2abf3e5061f891b7f07953ef3b0695f52c89 (patch) | |
tree | a48c4cbea302eb1d41bc1d798c1e85bcc892ea8a /git-send-email.perl | |
parent | a7738c77f1f17ced885ce96e986b948a0b256452 (diff) | |
download | git-ef0c2abf3e5061f891b7f07953ef3b0695f52c89.tar.gz |
Add GIT_EDITOR environment and core.editor configuration variables
These variables let you specify an editor that will be launched in
preference to the EDITOR and VISUAL environment variables. The order
of preference is GIT_EDITOR, core.editor, EDITOR, VISUAL.
[jc: added a test and config variable documentation]
Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index 7552caca4b..a09b1c9650 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -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 @@ -341,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") |