config: add send-me-too configuration
PATCH v2 1/1 config: add send-me-too configuration
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).
---
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(-)
docs/config.rst +6 -0
@@ -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``).
docs/contributor/send.rst +3 -1
@@ -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.
src/b4/__init__.py +2 -0
@@ -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
src/b4/ez.py +2 -1
@@ -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,
Signature · 1 line
Jeremy Kerr <[email protected]>
Konstantin Ryabitsev
AppliedQuoted 1 line · Jeremy Kerr
config: add send-me-too configuration
Applied, thanks!
[1/1] config: add send-me-too configuration
commit: c01d0e69bd1666253839bab79912f440e5edfee0
Best regards,
Signature · 1 line
Konstantin Ryabitsev <[email protected]>