1

Pretty much what the title says. I get the following error:

/mingw64/libexec/git-core/git-legacy-rebase--interactive: line 94: rebase-editor: command not found
Could not execute editor

I know there are similar questions out there but all I found on those was "editor is not set correctly, do xy". Which I did. My config lists:

core.editor='G:/Anwendungen/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin

I still get the error though. Weirdly when I do --no-ff merges, notepad++ opens just fine.

Any ideas?

Wolfone
  • 1,276
  • 3
  • 11
  • 31
  • The text `line 94: rebase-editor: command not found` indicates that the rebase command thinks your chosen editor is `rebase-editor`, not `G:/Anwen...[snipped]`. Why *that* is the case, I don't know, but `/mingw64/libexec/git-core/git-legacy-rebase--interactive` is a shell script that implements the older interactive rebase. Being a shell script, you can just read it and figure out why it thinks that. – torek Feb 23 '21 at 07:15
  • Thanks for the comment. I looked and that's the line ```eval "$GIT_SEQUENCE_EDITOR" '"$@"'```. Doesn't look too fishy from my noob-perspective. I wonder why git would use the legacy-rebase command in the first place as a non-legacy one exists. – Wolfone Feb 23 '21 at 07:31
  • As you found with VonC, this was due to setting the sequence editor. The `$GIT_SEQUENCE_EDITOR` selection is used to edit the *instruction sheet*. The `$GIT_EDITOR` selection is used to edit later *commit messages*. Normally both are the same editor, but you can set one or both differently for special purposes. It's a bad idea to *configure* them differently, as you've just seen, as this bites you later... – torek Feb 23 '21 at 08:52
  • True true! Thanks for the additional info on the internal ongoings! I appreciate the opportunity to learn. – Wolfone Feb 23 '21 at 09:09

1 Answers1

2

Try and upgrade Git to the latest 2.30.1: my Git For Windows does not include any git-legacy... script.

As documented in "A faster way to git rebase --preserve-merges", git rebase is now almost fully implemented in C, and should use your git config core.editor setting.

The OP confirms:

  • the issue persists even with 2.30.1
  • the problem was with the setting sequence.editor: removing it means When using the default commit message editor instead.
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Funny :D I just did that and wanted to come back to comment on the result, which is: it's still not working but with an updated error message.```hint: Waiting for your editor to close the file... error: cannot spawn rebase-editor: No such file or directory error: unable to start editor 'rebase-editor'``` (I made sure that ```core.editor``` is still set after the update.) – Wolfone Feb 23 '21 at 07:40
  • @Wolfone `'rebase-editor'` is not something that exists in Git. Can you see "rebase-editor" in the output of a `git config -l`? – VonC Feb 23 '21 at 07:45
  • Ha! Good hint! ```core.editor``` was not the culprit but ```sequence.editor```! I assume that this was still set by a cli-rebase-editor that I had installed some time ago. If you update your answer accordingly I will gladly accept it. Thanks! – Wolfone Feb 23 '21 at 07:52
  • @Wolfone Good catch. I have edited the answer accordingly. – VonC Feb 23 '21 at 07:59