add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
Use the new "git var GIT_EDITOR" feature to decide what editor to use, instead of duplicating its logic elsewhere. This should make the behavior of commands in edge cases (e.g., editor names with spaces) a little more consistent. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
6361824589
commit
b4479f0747
@ -729,13 +729,10 @@ class P4Submit(Command):
|
||||
tmpFile.write(submitTemplate + separatorLine + diff + newdiff)
|
||||
tmpFile.close()
|
||||
mtime = os.stat(fileName).st_mtime
|
||||
defaultEditor = "vi"
|
||||
if platform.system() == "Windows":
|
||||
defaultEditor = "notepad"
|
||||
if os.environ.has_key("P4EDITOR"):
|
||||
editor = os.environ.get("P4EDITOR")
|
||||
else:
|
||||
editor = os.environ.get("EDITOR", defaultEditor);
|
||||
editor = read_pipe("git var GIT_EDITOR")
|
||||
system(editor + " " + fileName)
|
||||
|
||||
response = "y"
|
||||
|
Reference in New Issue
Block a user