Re: [GSoC][PATCH v3 03/13] editor: add a function to launch the sequence editor
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 10, 2018, 17:58 UTC
- Message-ID
- <xmqqy3ej6khs.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180710121557.6698-4-alban.gruin@gmail.com>
For those reading from sidelines, this is unchanged from the previous round, and looking good.
Alban Gruin <alban.gruin@gmail.com> writes:
Show 18 quoted lines
> +const char *git_sequence_editor(void)
> {
> - const char *editor = git_editor();
> + const char *editor = getenv("GIT_SEQUENCE_EDITOR");
> +
> + if (!editor)
> + git_config_get_string_const("sequence.editor", &editor);
> + if (!editor)
> + editor = git_editor();
>
> + return editor;
> +}
> +
> +static int launch_specified_editor(const char *editor, const char *path,
> + struct strbuf *buffer, const char *const *env)
> +{
> if (!editor)
> return error("Terminal is dumb, but EDITOR unset");Nice code reuse.