Re: [PATCH v4] Teach git var about GIT_EDITOR
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:39
Jonathan Nieder [off-list ref] writes:
Expose the command used by launch_editor() for scripts to use. This should allow one to avoid searching for a proper editor separately in each command.
Ok, so the idea is... * git_editor(void) uses the logic to decide which editor to use that used to live in launch_editor(). The function returns NULL if there is no suitable editor; the caller is expected to issue an error message when appropriate. * launch_editor() uses git_editor() and gives the error message the same way as before when EDITOR is not set. * "git var GIT_EDITOR" gives the editor name, or an error message when there is no appropriate one. * "git var -l" gives GIT_EDITOR=name only if there is an appropriate editor. The above all look sensible, but IIRC, the true "vi" fell back on "ex" mode on dumb terminals and was usable as a line editor, so we should be able to run it even on dumb terminals. I do not know about vi-clones though.