public inbox for tools@linux.kernel.org
 help / color / mirror / Atom feed
* Overriding editor with b4 prep --edit-cover
@ 2026-04-15  9:51 Alice Ryhl
  2026-04-15 13:44 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 2+ messages in thread
From: Alice Ryhl @ 2026-04-15  9:51 UTC (permalink / raw)
  To: tools

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?

Alice

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Overriding editor with b4 prep --edit-cover
  2026-04-15  9:51 Overriding editor with b4 prep --edit-cover Alice Ryhl
@ 2026-04-15 13:44 ` Konstantin Ryabitsev
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2026-04-15 13:44 UTC (permalink / raw)
  To: Alice Ryhl; +Cc: tools

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-15 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-15  9:51 Overriding editor with b4 prep --edit-cover Alice Ryhl
2026-04-15 13:44 ` Konstantin Ryabitsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox