-
Notifications
You must be signed in to change notification settings - Fork 50
Fix PR template and Reviewable from merge commits #40
base: master
Are you sure you want to change the base?
Conversation
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. This leaves a much cleaner commit message in the merge commit. Tested against an excerpt of recent commit messages from Servo.
5688e30
to
1189a45
Compare
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 |
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, |
Or |
☔ The latest upstream changes (presumably #103) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
This change is