Skip to contentSkip to conversation

Fall back to EMAIL environment email

PATCH Applied Alyssa Ross 2 participants 2 messages Mar 17, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fall back to EMAIL environment email

This matches git's behavior. Without this change, b4 shazam would catch the KeyError and exit 1 with no error message. This will still happen if EMAIL is also unset.

---
 b4/__init__.py | 2 ++
 1 file changed, 2 insertions(+)
b4/__init__.py +2 -0
index 94c1693..31d7672 100644
@@ -2579,6 +2579,8 @@ def get_user_config():
         if 'name' not in USER_CONFIG:
             udata = pwd.getpwuid(os.getuid())
             USER_CONFIG['name'] = udata.pw_gecos
+        if 'email' not in USER_CONFIG:
+            USER_CONFIG['email'] = os.environ['EMAIL']
     return USER_CONFIG
 
 
Signature · 1 line
2.37.1
#1 lore raw
Quoted 5 lines · Alyssa Ross

This matches git's behavior. Without this change, b4 shazam would catch the KeyError and exit 1 with no error message. This will still happen if EMAIL is also unset.

Applied, thanks!

[1/1] Fall back to EMAIL environment email

      commit: 20972c58601f9a6ff4440e23be8d6261c6bc5b93

Best regards,

Signature · 1 line
Konstantin Ryabitsev <[email protected]>