Squash merge: "---------" separator before Co-authored-by pushes trailers in the PR description out of git's trailer block #212930
Replies: 3 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
This comment was marked as low quality.
This comment was marked as low quality.
|
Confirmed empirically with A control group pins it down: the same commit with the co-author line in its own final paragraph parses cleanly ( Why this may matter beyond cosmetics: several Pair Extraordinaire non-issuance reports in the achievements incident thread (#203416) involve co-authored squash merges, and if any downstream attribution relies on git's trailer semantics rather than GitHub's looser UI rendering, this format orphans exactly those credits. Two workarounds until the format changes:
|
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
Body
What is happening
When a pull request is squash-merged with the default commit message "Pull request
title and description" and the PR has commits from more than one author, GitHub
appends the co-authors as a separate paragraph after a "---------" line:
git only reads the last paragraph of a message as its trailer block. Any trailer
written at the end of the PR description (here
Ref:, but alsoSigned-off-by:,Reviewed-by:,Fixes:etc.) is therefore no longer a trailer:Listing the co-author in the description directly under
Ref:does not help:GitHub appends its own block anyway and the co-author appears twice.
Steps to reproduce
title and description".
a trailer, e.g.
Ref:AB#123.gh pr merge --squash).git interpret-trailers --parseon the merge commit.Expected
The description's trailers and the co-authors end up in one trailer block, e.g.
Why it matters
Teams that squash-merge put work item references and other trailers in the PR
description because it becomes the commit message. Release tooling, changelog
generators and commit checks read them with git's trailer parsing
(
%(trailers),git interpret-trailers). As soon as a PR has a co-author, thosetrailers silently disappear from the history.
Suggestion
If the generated message already ends with a trailer block, append the
Co-authored-by lines to that block instead of adding "---------" and a new
paragraph. Alternatively, a repository setting to omit the separator.
All reactions