Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Don't close issues mentioned in Pull Request commit messages

I am currently maintaining my first open source projects and I keep running into the same scenario.

  1. I get a Pull Request that is good, but it doesn't completely resolve an issue, but the user mentioned the issue in a commit message like Resolves #14 which means it will automatically close the issue when I merge the Pull Request.
  2. I merge the Pull Request because I want the Pull Request code, which automatically closes the issue.
  3. I go back to the issue and reopen it.

This is ok, but it's kind of a hassle and it leads to issues that look like this

enter image description here

That look like they have been closed and reopened a bunch of times. Is there a way to prevent this automatic closing to keep the issue history cleaner?

like image 832
Luke Schlangen Avatar asked Jul 15 '26 18:07

Luke Schlangen


1 Answers

As far as I know, the completion of the pull request (i.e. the merge) is coupled with the closing of the branch being merged. The usual way I have avoided this in the past is to simply not approve a pull request which has pending issues. Instead, leave comments on the pull request and only complete the merge when those issues have been addressed. Keep in mind that the owner of the feature branch can continue to make commits, and the pull request will automatically update.

I believe that both GitHub and Bitbucket do have the option to keep a branch open after the merge, but generally we would not merge a branch a second time after it has already been merged once. So allowing your reviewee to make changes to the pull request is a good way to proceed.

like image 190
Tim Biegeleisen Avatar answered Jul 17 '26 17:07

Tim Biegeleisen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!