roll_util: Truncate long initial lines

Change-Id: Ib2e85051dcac696aeb25727e4837fc4545ddda40
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/93500
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/recipe_modules/roll_util/api.py b/recipe_modules/roll_util/api.py
index ea47c17..f685722 100644
--- a/recipe_modules/roll_util/api.py
+++ b/recipe_modules/roll_util/api.py
@@ -68,11 +68,19 @@
     Prepend 'Original-' to lines which begin with ESCAPE_TAGS. Filter
     out lines which begin with FILTER_TAGS.
     """
+
+    lines = message.splitlines()
+
+    # If the first line is really long create a truncated version of it, but
+    # keep the original version of the commit message around.
+    if len(lines[0]) > 80:
+        lines = [lines[0][0:50], ''] + lines
+
     return '\n'.join(
         "Original-" + line
         if any((line.startswith(tag) for tag in ESCAPE_TAGS))
         else line
-        for line in message.splitlines()
+        for line in lines
         if not any((_match_tag(line, tag) for tag in FILTER_TAGS))
     )