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>
This commit is contained in:

committed by
Junio C Hamano

parent
a7738c77f1
commit
ef0c2abf3e
@ -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")
|
||||
|
Reference in New Issue
Block a user