[PATCH b4] config: add send-me-too configuration

Jeremy Kerr <[email protected]>
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]>
---
 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..5769cd7 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 3e81138..39168e6 100644
--- a/src/b4/ez.py
+++ b/src/b4/ez.py
@@ -2252,7 +2252,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 = config.get('send-me-too').lower()
+        if cmdargs.not_me_too or conf_me_too in {'no', 'n', 'false'}:
             excludes.add(myemail)
 
     tos = set()

---
base-commit: d5d981426ead3f490713ef5d2fd1aa3d0f13b005
change-id: 20260429-master-846cbbaed205

Best regards,
--  
Jeremy Kerr <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.