Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: tools@linux.kernel.org
Cc: users@linux.kernel.org
Subject: [PATCH] send: Use only the default git 'sendemail' config when no identity is set
Date: Thu, 25 Aug 2022 13:25:06 -0500	[thread overview]
Message-ID: <20220825182506.1449442-1-robh@kernel.org> (raw)

With no git sendemail 'identity' set, b4 send picks up all the identities
and uses the wrong settings.

Signed-off-by: Rob Herring <robh@kernel.org>
---
This only partially fixes the sendemail handling. If an identity is set,
we need to merge the identity's section with the default section as an
identity may not contain a complete configuration.
---
 b4/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/b4/__init__.py b/b4/__init__.py
index 4296b109d118..a8ddf8534eaf 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -2759,7 +2759,7 @@ def get_smtp(identity: Optional[str] = None,
         sconfig = get_config_from_git(rf'sendemail\.{identity}\..*')
         sectname = f'sendemail.{identity}'
     else:
-        sconfig = get_config_from_git(rf'sendemail\..*')
+        sconfig = get_config_from_git(rf'sendemail\.[^.]+$')
         sectname = 'sendemail'
     if not len(sconfig):
         raise smtplib.SMTPException('Unable to find %s settings in any applicable git config' % sectname)
-- 
2.34.1


             reply	other threads:[~2022-08-25 18:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 18:25 Rob Herring [this message]
2022-08-29 21:07 ` [PATCH] send: Use only the default git 'sendemail' config when no identity is set Konstantin Ryabitsev

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=20220825182506.1449442-1-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=tools@linux.kernel.org \
    --cc=users@linux.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