aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-07-20 17:38:02 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-07-20 17:38:02 -0400
commitd952f4b20bc1e805223e2aaf62ae69cb1d41fbea (patch)
tree96258c18bf5126d52d02bc03775f1be556b90dfc
parentc3405761fafed6a08824297e8792391857452bb2 (diff)
downloadb4-d952f4b20bc1e805223e2aaf62ae69cb1d41fbea.tar.gz
ez-send: don't wrap headers in format-patch mode
When writing out message in format-patch compatibility mode, do not wrap headers, otherwise checkpatch or git-send-email may complain. Reported-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/ez.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/b4/ez.py b/b4/ez.py
index cec3a10..35bb622 100644
--- a/b4/ez.py
+++ b/b4/ez.py
@@ -710,11 +710,6 @@ def cmd_ez_send(cmdargs: argparse.Namespace) -> None:
body = Template(cover_template.lstrip()).safe_substitute(tptvals)
cmsg = email.message.EmailMessage()
cmsg.add_header('Subject', csubject)
- # Store tracking info in the header in a safe format, which should allow us to
- # fully restore our work from the already sent series.
- ztracking = gzip.compress(bytes(json.dumps(tracking), 'utf-8'))
- b64tracking = base64.b64encode(ztracking)
- cmsg.add_header('X-b4-tracking', ' '.join(textwrap.wrap(b64tracking.decode(), width=78)))
cmsg.set_payload(body, charset='utf-8')
if cmdargs.prefixes:
prefixes = list(cmdargs.prefixes)
@@ -856,7 +851,7 @@ def cmd_ez_send(cmdargs: argparse.Namespace) -> None:
ls = b4.LoreSubject(subject)
filen = '%s.patch' % ls.get_slug(sep='-')
with open(os.path.join(cmdargs.output_dir, filen), 'w') as fh:
- fh.write(msg.as_string(unixfrom=True, maxheaderlen=80))
+ fh.write(msg.as_string(unixfrom=True, maxheaderlen=0))
logger.info(' %s', filen)
return
@@ -898,7 +893,12 @@ def cmd_ez_send(cmdargs: argparse.Namespace) -> None:
continue
if cover_msgid is None:
cover_msgid = b4.LoreMessage.get_clean_msgid(msg)
- msg.add_header('To', b4.format_addrs(allto))
+ # Store tracking info in the header in a safe format, which should allow us to
+ # fully restore our work from the already sent series.
+ ztracking = gzip.compress(bytes(json.dumps(tracking), 'utf-8'))
+ b64tracking = base64.b64encode(ztracking)
+ cmsg.add_header('X-b4-tracking', ' '.join(textwrap.wrap(b64tracking.decode(), width=78)))
+ msg.add_header('To', b4.format_addrs(allto))
if allcc:
msg.add_header('Cc', b4.format_addrs(allcc))
logger.info(' %s', msg.get('Subject'))