From 8f4b576ad14943a7b14cb8937eb321b7bfd91ee7 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 30 Oct 2009 20:44:41 -0500 Subject: Provide a build time default-editor setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Ben Walton Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- editor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'editor.c') diff --git a/editor.c b/editor.c index 70618f1066..615f5754d6 100644 --- a/editor.c +++ b/editor.c @@ -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; } -- cgit v1.2.3