Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up'Linking an issue to PR' doco should highlight it only works on the default branch #165
Comments
Fixes part of github#165 (last suggestion made by the author)
Fixes github#165 . I added a Note box at the end of the document, and a reference to it at the top of the document - should be enough warning without disrupting the rest of the text. Also changed the introdutory line in the "Linking a pull request(...)" section as suggested by the author.


What feature or product is affected?
The
managing-your-work-on-github/linking-a-pull-request-to-an-issue.mdpage which covers how special keywords can be used in pull request descriptions.Basically, the code looks in the description for special terms and parses them to create links to issues, and additionally, issues are closed when the pull request is merged.
The special keywords in a pull request description are interpreted when the pull request targets the repository's default branch.
However, if the PR's base is any other branch, then these keywords are ignored, no links are created and merging the PR has no effect on the issues.
What is the new or expected behavior?
In particular, we should mention that both linking and closing behaviours only apply to PRs that target the repository's default branch.
Secondly, IMHO this condition is important enough that we should also highlight it, perhaps in a big yellow box or similar. Having it in a single sentence as part of a paragraph makes it much too easy to miss.
How is the old or inaccurate behavior currently documented?
In
managing-your-work-on-github/linking-a-pull-request-to-an-issue.md, the first section mentions that issues can be linked from a pull request. However, this is misleading and incomplete, as it does not say that this only happens when the PR base branch is the repository default branch.The closing section does allude to the behaviour when it says:
This is a single statement, so it is very easy to miss amongst the rest of the document and our documentation.
It is also very weakly stated - it only applies to one half the situation. This is not just an "if" condition, it is an "if and only if".
Content to update
In
managing-your-work-on-github/linking-a-pull-request-to-an-issue.md: