diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2009-10-30 20:42:34 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-13 12:20:50 -0800 |
commit | b4479f074760a788dd4e353b8c86a7d735afc53e (patch) | |
tree | 5680844fb47dd256945296a8466de81a4bfb17ec /contrib | |
parent | 6361824589bc2d32989a9a33f985d09a368436a3 (diff) | |
download | git-b4479f074760a788dd4e353b8c86a7d735afc53e.tar.gz |
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>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/fast-import/git-p4 | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index e710219ca5..48059d0aa7 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -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" |