-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clear-pr-merge-commit-message
should preserve which issues a PR closes when it is not merged into the default branch
#4531
Comments
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'd consider it a feature request, yes. |
This just needs a regex to detect and preserve these |
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
Maybe https://www.npmjs.com/package/regex-join could also help |
Don't understand why we cant just do on the first post and extract the issue number select.all('[aria-label="This pull request closes issue*"]') |
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? |
The only way to check is by trying it out 😀 If I remember correctly they only close if its the default branch by design. |
It does not close it |
Great, thanks! |
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
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 butCo-authored-by: <...>
The text was updated successfully, but these errors were encountered: