homu
homu copied to clipboard
Fix PR template and Reviewable from merge commits
We recently added a PR template to the main Servo repo to smooth the contributing workflow. However, this template gets copied into homu's merge commit messages, generating a lot of noise in the commit logs.
Use heuristics to strip both the PR template and the Reviewable footer. First, the main body of the PR template and the Reviewable footer are removed, as these are always the same (except for if the boxes are checked) and always at the bottom. The other part of the PR template is a header comment; some users replace it, while others leave it, and even though the message says to write below that line, some users write above it. So, simply remove it and trim any extra newlines. These heuristics should robustly leave the body untouched if the template is changed.
Tested against an excerpt of recent commit messages from Servo.
Fixes #36. Fixes servo/servo#11153. Supersedes #37.
So the checks are preserved? (since one of the rows asks you to mention an issue number, which we want)
Right now it strips that out, but I can make it keep that line if the issue number isn't blank. Is there anything else that should be kept from the PR template?
Yeah, please keep it. Otherwise, not that I know of
Can we add <!-- homu strip -->
comments to the template instead?
Designating the parts to strip in the template itself makes sense to me. We should be sure to do so in a way that doesn't make it more confusing, however.
Yes, <!-- homu strip -->
sounds a lot better to me - it avoids us hardcoding servo inside homu.
Or <hr class="homu-strip">
, this way it's even visible.
:umbrella: The latest upstream changes (presumably #103) made this pull request unmergeable. Please resolve the merge conflicts.