diff mbox series

[b4] Fallback to sendemail.identity when b4.sendmail-identity is undefined

Message ID 20240823-feat-use-sendemail-identity-v1-1-7b9f7d0e0ae3@gmail.com (mailing list archive)
State Accepted
Headers show
Series [b4] Fallback to sendemail.identity when b4.sendmail-identity is undefined | expand

Commit Message

Celeste Liu Aug. 23, 2024, 10:05 a.m. UTC
To match the behavior if git sendmail better.

Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
---
 src/b4/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: 37811c93f50e70f325e45107a9a20ffc69f2f6dc
change-id: 20240823-feat-use-sendemail-identity-98a3e58396cb

Best regards,

Comments

Konstantin Ryabitsev Sept. 6, 2024, 3:03 p.m. UTC | #1
On Fri, 23 Aug 2024 18:05:57 +0800, Celeste Liu wrote:
> To match the behavior if git sendmail better.
> 
> 

Applied, thanks!

[1/1] Fallback to sendemail.identity when b4.sendmail-identity is undefined
      commit: ff3bc6ddb5ddfd17a2cebb67b765c00023c1a891

Best regards,
diff mbox series

Patch

diff --git a/src/b4/__init__.py b/src/b4/__init__.py
index 2b1a058..5908de8 100644
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -3727,8 +3727,8 @@  def _setup_sendemail_config(cmdargs: argparse.Namespace) -> None:
 
     # Get the default settings first
     config = get_main_config()
-    identity = config.get('sendemail-identity')
     _basecfg = get_config_from_git(r'sendemail\.[^.]+$')
+    identity = config.get('sendemail-identity') or _basecfg.get('identity')
     if identity:
         # Use this identity to override what we got from the default one
         sconfig = get_config_from_git(rf'sendemail\.{identity}\..*', defaults=_basecfg)