aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-27 12:23:00 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-03-27 12:23:00 -0400
commitf0151eb4fd9568a96de69509004ad20534857954 (patch)
tree17a76739357db3750433b12785d52d09dc4f2093
parentb46d618a6538471447fbbd85ec56f2d037300cf0 (diff)
downloadb4-f0151eb4fd9568a96de69509004ad20534857954.tar.gz
Add "email" to badtrailers
Not sure if it makes more sense to switch to a "known trailers" scheme instead of keeping a list of what is clearly not a trailer. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index e61958a..df6fa23 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -594,7 +594,7 @@ class LoreMessage:
# Do we have something that looks like a person-trailer?
matches = re.findall(r'^\s*([\w-]+):[ \t]+(.*<\S+>)\s*$', self.body, re.MULTILINE)
# These are commonly part of patch/commit metadata
- badtrailers = ('from', 'author')
+ badtrailers = ('from', 'author', 'email')
if matches:
for tname, tvalue in matches:
if tname.lower() not in badtrailers:
@@ -683,8 +683,7 @@ class LoreMessage:
@staticmethod
def clean_header(hdrval):
- uval = hdrval.replace('\n', ' ')
- new_hdrval = re.sub(r'\s+', ' ', uval)
+ new_hdrval = re.sub(r'\n?\s+', ' ', str(hdrval))
return new_hdrval.strip()
@staticmethod