Luke Schlangen
Luke Schlangen

Reputation: 3882

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?

Upvotes: 3

Views: 2149

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 520908

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.

Upvotes: 2

Related Questions