[PATCH b4 v2] config: add send-me-too configuration
Jeremy Kerr <[email protected]> Wed, 10 Jun 2026 10:52:44 +0800
| Newsgroups | org.kernel.linux.tools |
|---|---|
| Message-ID | <[email protected]> |
My mail transport automatically saves a copy of outgoing patches, so I'm always using the `--no-me-too` argument to `b4 send`. Instead of having to specify this every time, add a configuration option to control the send-to-myself setting. In order to avoid double-negatives in configuration (ie., `send-not-me-too = no`), use an affirmative version, `send-me-too`, which defaults to `yes` (the current behaviour). Signed-off-by: Jeremy Kerr <[email protected]> --- Changes in v2: - address feedback from Konstantin: - fix markup for fixed-width formatting (` -> ``) - reflow rst to 72 cols - explicitly str() our config.get() result, and provide a default. - Link to v1: https://patch.msgid.link/[email protected] --- docs/config.rst | 6 ++++++ docs/contributor/send.rst | 4 +++- src/b4/__init__.py | 2 ++ src/b4/ez.py | 3 ++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index 2490f54..7251786 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -725,6 +725,12 @@ Contributor-oriented settings Default: ``no`` + :term:`b4.send-me-too` + Instructs b4 to include your own address when sending. Set by default, + use ``no`` to suppress sending to yourself. + + Default: ``yes`` + :term:`b4.send-prefixes` Extra prefixes to add to ``[PATCH]`` (e.g. ``RFC mydrv``). diff --git a/docs/contributor/send.rst b/docs/contributor/send.rst index ba18ef5..da8d701 100644 --- a/docs/contributor/send.rst +++ b/docs/contributor/send.rst @@ -321,7 +321,9 @@ Command line flags :ref:`contributor_settings`). ``--not-me-too`` - Removes your own email address from the recipients. + Removes your own email address from the recipients. This can be set in + the configuration using the :term:`b4.send-me-too`, setting to ``no``. + (see :ref:`contributor_settings`). ``--no-sign`` Don't sign your patches with your configured attestation mechanism. diff --git a/src/b4/__init__.py b/src/b4/__init__.py index 0530fec..fae5de6 100644 --- a/src/b4/__init__.py +++ b/src/b4/__init__.py @@ -177,6 +177,8 @@ DEFAULT_CONFIG: ConfigDictT = { 'review-target-branch': None, # Do not patatt-sign outgoing review emails 'review-no-patatt-sign': None, + # Send to myself + 'send-me-too': 'yes', } # This is where we store actual config diff --git a/src/b4/ez.py b/src/b4/ez.py index d1e2fba..06104b6 100644 --- a/src/b4/ez.py +++ b/src/b4/ez.py @@ -2253,7 +2253,8 @@ def cmd_send(cmdargs: argparse.Namespace) -> None: ccdests.append(btr.addr) excludes = b4.get_excluded_addrs() - if cmdargs.not_me_too: + conf_me_too = str(config.get('send-me-too', 'yes')).lower() + if cmdargs.not_me_too or conf_me_too in {'no', 'n', 'false'}: excludes.add(myemail) tos = set() --- base-commit: 747e1e89d289188fc5f5815f144a3a66f7ffa362 change-id: 20260429-master-846cbbaed205 Best regards, -- Jeremy Kerr <[email protected]>