* [PATCH] send: Use only the default git 'sendemail' config when no identity is set
@ 2022-08-25 18:25 Rob Herring
2022-08-29 21:07 ` Konstantin Ryabitsev
0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2022-08-25 18:25 UTC (permalink / raw)
To: tools; +Cc: users
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] send: Use only the default git 'sendemail' config when no identity is set
2022-08-25 18:25 [PATCH] send: Use only the default git 'sendemail' config when no identity is set Rob Herring
@ 2022-08-29 21:07 ` Konstantin Ryabitsev
0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2022-08-29 21:07 UTC (permalink / raw)
To: Rob Herring; +Cc: tools, users
On Thu, Aug 25, 2022 at 01:25:06PM -0500, Rob Herring wrote:
> 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.
Thank you for the suggestion. I didn't end up using your patch, but I adapted
it to implement the fall-through behaviour that is compliant with how git
does it.
Regards,
Konstantin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-29 21:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25 18:25 [PATCH] send: Use only the default git 'sendemail' config when no identity is set Rob Herring
2022-08-29 21:07 ` Konstantin Ryabitsev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox