diff --git a/homu/main.py b/homu/main.py index 1754de18..2520d208 100644 --- a/homu/main.py +++ b/homu/main.py @@ -450,7 +450,7 @@ def create_merge(state, repo_cfg, branch, git_cfg): state.head_ref, '' if state.try_ else state.approved_by, state.title, - state.body, + utils.strip_pr_body(state.body), ) desc = 'Merge conflict' diff --git a/homu/utils.py b/homu/utils.py index afa3fa1a..11834e16 100644 --- a/homu/utils.py +++ b/homu/utils.py @@ -99,3 +99,16 @@ def retry_until(inner, fail, state): traceback.print_exception(*exc_info) fail(err) + + +def strip_pr_body(pr_body): + """ + Strip noisy parts of the Servo PR template from merge commits. + """ + # Strip most of the template and Reviewable + pr_footer = '\n---\n' + return stripped_body.replace(pr_header, '').strip()