diff mbox series

patman: Apply the cc limit to the cover letter also

Message ID 20200227184918.1.I750b1cbd9e7ffe7324ff64669c0ea2fe04bbeddf@changeid
State Accepted
Commit cf0ef9317cdb8a9b5be433f9c9da4c96ae7433d1
Delegated to: Simon Glass
Headers show
Series patman: Apply the cc limit to the cover letter also | expand

Commit Message

Simon Glass Feb. 28, 2020, 1:49 a.m. UTC
Quite often on a series that has clean-up patches, the individual patches
may fit within the cc limit but the cover letter does not. Apply the same
limit to the cover letter.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/series.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/patman/series.py b/tools/patman/series.py
index a15f7625ed..6d9d48b123 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -249,8 +249,10 @@  class Series(dict):
         if cover_fname:
             cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
             cover_cc = [tools.FromUnicode(m) for m in cover_cc]
-            cc_list = '\0'.join([tools.ToUnicode(x)
-                                 for x in sorted(set(cover_cc + all_ccs))])
+            cover_cc = list(set(cover_cc + all_ccs))
+            if limit is not None:
+                cover_cc = cover_cc[:limit]
+            cc_list = '\0'.join([tools.ToUnicode(x) for x in sorted(cover_cc)])
             print(cover_fname, cc_list, file=fd)
 
         fd.close()