You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clear-pr-merge-commit-message should preserve which issues a PR closes when it is not merged into the default branch #4531
I'm looking for a good way to keep a linear commit history, and work on new release branches while being able to preserve GitHub's auto-close feature for issues when a PR gets merged into master. My plan is to merge PRs (I'm squash-merging) into a develop branch and when I deem it to be ready, locally rebase it on top of master, then fast-forward master. Unfortunately the rebase step (or if I were to squash-merge the branch), GitHub forgets which issues should be closed.
If the commit bodies would contain the information of which issues get closed, for example
fixes: #1234
fixes: #4567
...
the commits would still cause Github to close the referenced issues, no matter how the commits finally end up in master.
To summarize, I'm asking for a way to automatically put the linked issues of a PR in the final commit message when the PR is not merged into the default branch. Currently, clear-pr-merge-commit-message clears everything but Co-authored-by: <...>
Reacted by fregante, Jakub Čábera and Parth Jadhav
To summarize, I'm asking for a way to automatically put the linked issues of a PR in the final commit message when the PR is not merged into the default branch.
So if I'm not mistaken, this is a not a bug, but a new feature request? Because afaik GitHub doesn't natively include references to the closed issues in the commit description.
I consider it a bug as it's breaking native GH behavior
But afaict, GitHub doesn't automatically add this info to the "extended description" box in the first place.
It's true that if you link the issue via UI or "fixes" keyword in a comment, they won't add it to the description.
But they do when fixes #n appears in the commit description itself. This situation is relatively niche, but it's also a regex away. I suppose the regex would be kinda complex however, like:
It wouldn't preserve the same wording but that's totally fine for me. 💙
We need to verify if this is still happening though, I'd kinda be surprised that GitHub doesn't close the issues regardless of the branch, especially with the new "linked issues" in the sidebar. Do they have the same behavior?
Activity
cheap-glitch commentedon Nov 21, 2021
So if I'm not mistaken, this is a not a bug, but a new feature request? Because afaik GitHub doesn't natively include references to the closed issues in the commit description.
AlCalzone commentedon Nov 21, 2021
I'd consider it a feature request, yes.
fregante commentedon Dec 3, 2021
This just needs a regex to detect and preserve these
fixes/resolves/fix/etckeywords. I consider it a bug as it's breaking native GH behaviorcheap-glitch commentedon Dec 4, 2021
But afaict, GitHub doesn't automatically add this info to the "extended description" box in the first place.
fregante commentedon Dec 5, 2021
It's true that if you link the issue via UI or "fixes" keyword in a comment, they won't add it to the description.
But they do when
fixes #nappears in the commit description itself. This situation is relatively niche, but it's also a regex away. I suppose the regex would be kinda complex however, like:Maybe https://www.npmjs.com/package/regex-join could also help
yakov116 commentedon Oct 30, 2022
Don't understand why we cant just do on the first post and extract the issue number
fregante commentedon Oct 31, 2022
It wouldn't preserve the same wording but that's totally fine for me. 💙
We need to verify if this is still happening though, I'd kinda be surprised that GitHub doesn't close the issues regardless of the branch, especially with the new "linked issues" in the sidebar. Do they have the same behavior?
yakov116 commentedon Oct 31, 2022
The only way to check is by trying it out 😀
If I remember correctly they only close if its the default branch by design.
yakov116 commentedon Oct 31, 2022
refined-github/sandbox#52
It does not close it
AlCalzone commentedon Nov 13, 2022
Great, thanks!