From 5c6d813961002cf92fa2ab4fd244f7c2cd671d69 2014-05-16 17:40:37 From: MinRK Date: 2014-05-16 17:40:37 Subject: [PATCH] truncate PR description in backported git msg to five lines sometimes these things are huge. --- diff --git a/tools/backport_pr.py b/tools/backport_pr.py index 5077ff0..b8930a3 100755 --- a/tools/backport_pr.py +++ b/tools/backport_pr.py @@ -70,6 +70,11 @@ def backport_pr(branch, num, project='ipython/ipython'): req = urlopen(patch_url) patch = req.read() + lines = description.splitlines() + if len(lines) > 5: + lines = lines[:5] + ['...'] + description = '\n'.join(lines) + msg = "Backport PR #%i: %s" % (num, title) + '\n\n' + description check = Popen(['git', 'apply', '--check', '--verbose'], stdin=PIPE) a,b = check.communicate(patch)