Re: Overriding editor with b4 prep --edit-cover
Konstantin Ryabitsev <[email protected]>
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <20260415-caped-lemon-beaver-bab9ae@lemur> |
On Wed, Apr 15, 2026 at 11:51:56AM +0200, Alice Ryhl wrote:
> I want to invoke b4 prep --edit-cover with a different editor than the
> one configured by default for automation purposes. I tried various
> things such as changing configuration variables EDITOR, GIT_EDITOR,
> etc. I also tried
>
> b4 prep --config core.editor=<cmd> --edit-cover
>
> However, no matter what I tried, b4 just opens up NVIM as is
> configured in .gitconfig.
>
> Is there a way to override the editor?
Looking at the code, it would appear that if there is a core.editor set, it
always overrides any env variable passed. Passing --config to the b4 command
won't do the right thing, because the above would set "b4.core.editor" as the
variable, which is why it's not working.
The right course of action here is to reverse the logic and follow git's
preference:
GIT_EDITOR -> core.editor -> VISUAL -> EDITOR -> vi
I'll make a bug out of this.
--
KR