diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2009-10-30 20:44:41 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-11-13 12:20:54 -0800 |
commit | 8f4b576ad14943a7b14cb8937eb321b7bfd91ee7 (patch) | |
tree | 35fae4d9464c2884381cd9160177f64816629b22 /editor.c | |
parent | dec543e62dbc47be0c06805330a20f7fa9f699a3 (diff) | |
download | git-8f4b576ad14943a7b14cb8937eb321b7bfd91ee7.tar.gz |
Provide a build time default-editor setting
Provide a DEFAULT_EDITOR knob to allow setting the fallback
editor to use instead of vi (when VISUAL, EDITOR, and GIT_EDITOR
are unset). The value can be set at build time according to a
system’s policy. For example, on Debian systems, the default
editor should be the 'editor' command.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'editor.c')
-rw-r--r-- | editor.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2,6 +2,10 @@ #include "strbuf.h" #include "run-command.h" +#ifndef DEFAULT_EDITOR +#define DEFAULT_EDITOR "vi" +#endif + const char *git_editor(void) { const char *editor = getenv("GIT_EDITOR"); @@ -19,7 +23,7 @@ const char *git_editor(void) return NULL; if (!editor) - editor = "vi"; + editor = DEFAULT_EDITOR; return editor; } |