Better mechanism to choose the default editor (and avoid vi if possible)?

Arne Babenhauserheide arne_bab at web.de
Fri Jun 5 13:58:21 UTC 2020


Marcin Kasperski <Marcin.Kasperski at mekk.waw.pl> writes:
>> You need an editor to set the editor, so a default is required.
>
> Whenever I commit without having ui.username, I get:
>
>   $ hg commit -m Hello
>   abort: no username supplied
>   (use 'hg config --edit' to set your username)
>
> IIRC second line wasn't always there and we managed to live
> (of course hg config --edit is improvement).

The second line wasn’t always there, but it resolved the worst blocker
new users faced. This seemingly small change hit every new user.

> Still I don't think it would be horrible to face
>
>   $ hg something
>   abort: editor is not configured
>   (see `hg help setting-editor` or http://some/page/with/info
>    to find out how to configure your editor)
>
> Surely for some it would be better than land in vi, and for everybody
> it is better than land in non-existing vi. 
>
> And help-page can give exact examples for popular choices

If Mercurial would work harder to find some editor, this could be
reduced to the tiny fraction of people who have neither nano, nor vi,
nor emacs, no notepad, nor … installed.

In that case, the approach would look reasonable to me.

Currently the help output says (hg help config):

    …
    "editor"
        The editor to use during a commit. (default: "$EDITOR" or "vi")

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken



More information about the Mercurial mailing list