Commit 6ce18220 authored by Marc-Antoine Ruel's avatar Marc-Antoine Ruel Committed by Commit Bot

roll-dep: use Middle Out Compression️ for logs

Trimming at the bottom looses an important datapoint: which is the
oldest commit. To fix this problem, use Middle Out Compression️ to
creates a better DEPS roll CL description.

Change-Id: I290073d25989b6880a4b608cd2b8f26a300cc3a1
Reviewed-on: https://chromium-review.googlesource.com/c/1415430Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
parent edc89254
...@@ -113,8 +113,10 @@ def generate_commit_message( ...@@ -113,8 +113,10 @@ def generate_commit_message(
# internal -> external rollers. Please do not remove or break it. # internal -> external rollers. Please do not remove or break it.
if not no_log and should_show_log(upstream_url): if not no_log and should_show_log(upstream_url):
if len(cleaned_lines) > log_limit: if len(cleaned_lines) > log_limit:
# Keep the first N log entries. # Keep the first N/2 log entries and last N/2 entries.
logs = ''.join(logs.splitlines(True)[:log_limit]) + '(...)\n' lines = logs.splitlines(True)
lines = lines[:log_limit/2] + ['(...)\n'] + lines[-log_limit/2:]
logs = ''.join(lines)
log_section += logs log_section += logs
return header + log_section return header + log_section
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment