threads / discuss / 62617

git rebase --continue error message is misleading

Subject: git rebase --continue error message is misleading

## tl;dr

4 messages between Dec 9, 2024 and Feb 10, 2025.

replies: 3people: 3as markdown or json

Björn Lindqvist· Dec 9, 2024, 13:02 UTC · lore

$ LANG=C git rebase --continue hint: Waiting for your editor to close the file... error: cannot run vi: No such file or directory error: unable to start editor 'vi' Please supply the message using either -m or -F option. error: could not commit staged changes. $ git rebase --continue -m "done" ... $ git rebase --continue -F "done ffs" ...

It should say: Please commit the staged changes using git commit -m "commit message"

-- 
mvh/best regards Björn Lindqvist
Phillip Wood· Dec 13, 2024, 14:38 UTC · re: Björn Lindqvist · lore

Re: git rebase --continue error message is misleading

Hi Björn
Thanks for reporting this
On 09/12/2024 13:02, Björn Lindqvist wrote:
Show 5 quoted lines
> $ LANG=C git rebase --continue
> hint: Waiting for your editor to close the file... error: cannot run
> vi: No such file or directory
> error: unable to start editor 'vi'
> Please supply the message using either -m or -F option.

This line comes from "git commit" whenever launch_editor() fails. I wonder if we'd be better to recommend that the user sets up a working editor instead. The message is certainly unhelpful when we run "git commit" from "git cherry-pick/merge/rebase/revert" where we want to seed the message that the user edits.

Show 8 quoted lines
> error: could not commit staged changes.
> $ git rebase --continue -m "done"
> ...
> $ git rebase --continue -F "done ffs"
> ...
> 
> It should say: Please commit the staged changes using git commit -m
> "commit message"

I don't think that is a good idea when "git commit" is being run from "git rebase". In that case we want to preserve the original message and authorship and using '-F' or '-m' would not do that.

Best Wishes
Phillip
Björn Lindqvist· Feb 10, 2025, 10:19 UTC · re: Phillip Wood · lore

Re: git rebase --continue error message is misleading

Den fre 13 dec. 2024 kl 15:38 skrev Phillip Wood <phillip.wood123@gmail.com>:
Show 12 quoted lines
> On 09/12/2024 13:02, Björn Lindqvist wrote:
> > $ LANG=C git rebase --continue
> > hint: Waiting for your editor to close the file... error: cannot run
> > vi: No such file or directory
> > error: unable to start editor 'vi'
> > Please supply the message using either -m or -F option.
>
> This line comes from "git commit" whenever launch_editor() fails. I
> wonder if we'd be better to recommend that the user sets up a working
> editor instead. The message is certainly unhelpful when we run "git
> commit" from "git cherry-pick/merge/rebase/revert" where we want to seed
> the message that the user edits.
Here, I don't think assuming the user has vi installed is correct.
> I don't think that is a good idea when "git commit" is being run from
> "git rebase". In that case we want to preserve the original message and
> authorship and using '-F' or '-m' would not do that.
The error should tell you about that, I think. Right now I get:

LANG=C git commit hint: Waiting for your editor to close the file... error: cannot run vi: No such file or directory error: unable to start editor 'vi' Please supply the message using either -m or -F option.

The only solution I've found is git commit -m "blah".
-- 
mvh/best regards Björn Lindqvist
Junio C Hamano· Feb 10, 2025, 16:59 UTC · re: Björn Lindqvist · lore

Re: git rebase --continue error message is misleading

Björn Lindqvist <bjourne@gmail.com> writes:
> Here, I don't think assuming the user has vi installed is correct.

Exporting GIT_EDITOR that points at the editor of your choice is exactly for those who choose to use something else. Instead of erroring out with "You haven't told me what editor you want to use", editor.c has a fallback default to use DEFAULT_EDITOR that can be configured at the compile time, and if the builder does not configure it, then it falls back to "vi". We'd need to stop somewhere ;-)

← back to recent threads