summaryrefslogtreecommitdiff
path: root/tools/patman/patchstream.py
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2021-08-01 16:02:39 -0600
committerSimon Glass <[email protected]>2021-08-08 11:27:27 -0600
commit5974718752d80d3772bd0ef45630ba4ea8c2eb64 (patch)
treefcd50021f27193b7be3b6b802d229da78f048145 /tools/patman/patchstream.py
parent1e9ced28f18ed75bef96df08e47baad27dd51829 (diff)
patman: Avoid blank lines between tags
In some cases 'patman status' leaves a blank line between the sign-off and the tags it collects from patchwork. Fix this and add a test. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'tools/patman/patchstream.py')
-rw-r--r--tools/patman/patchstream.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index b9602924273..2439fb18e42 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -662,6 +662,7 @@ def insert_tags(msg, tags_to_emit):
out = []
done = False
emit_tags = False
+ emit_blank = False
for line in msg.splitlines():
if not done:
signoff_match = RE_SIGNOFF.match(line)
@@ -672,9 +673,13 @@ def insert_tags(msg, tags_to_emit):
out += tags_to_emit
emit_tags = False
done = True
+ emit_blank = not (signoff_match or tag_match)
+ else:
+ emit_blank = line
out.append(line)
if not done:
- out.append('')
+ if emit_blank:
+ out.append('')
out += tags_to_emit
return '\n'.join(out)