From: Konstantin Ryabitsev <mricon@kernel.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: tools@kernel.org
Subject: Re: Overriding editor with b4 prep --edit-cover
Date: Wed, 15 Apr 2026 09:44:19 -0400 [thread overview]
Message-ID: <20260415-caped-lemon-beaver-bab9ae@lemur> (raw)
In-Reply-To: <CAH5fLghw=fjJoWe3pt0QWVKpYXc_SzKmhYZdapkfWBOD9=1+rQ@mail.gmail.com>
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
prev parent reply other threads:[~2026-04-15 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 9:51 Overriding editor with b4 prep --edit-cover Alice Ryhl
2026-04-15 13:44 ` Konstantin Ryabitsev [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260415-caped-lemon-beaver-bab9ae@lemur \
--to=mricon@kernel.org \
--cc=aliceryhl@google.com \
--cc=tools@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox