send: Use only the default git 'sendemail' config when no identity is set
PATCH 1/1 send: Use only the default git 'sendemail' config when no identity is set
With no git sendemail 'identity' set, b4 send picks up all the identities and uses the wrong settings.
---
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(-)
b4/__init__.py +1 -1
@@ -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)
Signature · 1 line
2.34.1
Quoted 8 lines · Rob Herring
With no git sendemail 'identity' set, b4 send picks up all the identities and uses the wrong settings.
Signed-off-by Rob Herring <[email protected]>---
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