From 66f835fbabb2bf68ea1a6e9780c37662cc9cb017 Mon Sep 17 00:00:00 2001 From: Arthur Casals Date: Wed, 7 Oct 2020 23:26:40 +0200 Subject: [PATCH 1/4] Update linking-a-pull-request-to-an-issue.md Fixes #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. --- .../linking-a-pull-request-to-an-issue.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md index 1a2f101651d4..73ad0c970c08 100644 --- a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md +++ b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md @@ -13,7 +13,7 @@ versions: ### About linked issues and pull requests -You can link an issue to a pull request {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.20" %}manually or {% endif %}using a supported keyword in the pull request description. +You can link an issue to a pull request {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.20" %}manually or {% endif %}using a supported keyword in the pull request description. **Important:** this only happens when the PR base branch is the repository default branch (see **Note** below). When you link a pull request to the issue the pull request addresses, collaborators can see that someone is working on the issue. {% if currentVersion ver_lt "enterprise-server@2.21" %}If the pull request and the issue are in different repositories, {% data variables.product.product_name %} will display the link after the pull request is merged, if the person who merges the pull request also has permission to close the issue.{% endif %} @@ -37,7 +37,7 @@ You can manually link up to ten issues to each pull request. The issue and pull ### Linking a pull request to an issue using a keyword -You can link a pull request to an issue by using a supported keyword in the pull request's description. +You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message. * close * closes @@ -61,6 +61,13 @@ Multiple issues | Use full syntax for each issue | `Resolves #10, resolves #123, You can also use closing keywords in a commit message. The issue will be closed when you merge the commit into the default branch, but the pull request that contains the commit will not be listed as a linked pull request. +--- +**NOTE** + +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. **If you want to link a pull request to an issue using a keyword, the PR must be on the default branch.** + +--- + ### Further reading - "[Autolinked references and URLs](/articles/autolinked-references-and-urls/#issues-and-pull-requests)" From 457e266f98fb66dd50fe40f270aae42f094f033e Mon Sep 17 00:00:00 2001 From: Arthur Casals Date: Thu, 8 Oct 2020 21:34:15 +0200 Subject: [PATCH 2/4] Update linking-a-pull-request-to-an-issue.md Included callout tag for note. Moved note to the beginning of the text and removed the related observation in the next paragraph since it became redundant. --- .../linking-a-pull-request-to-an-issue.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md index 73ad0c970c08..85ed165fe61f 100644 --- a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md +++ b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md @@ -11,9 +11,15 @@ versions: enterprise-server: '*' --- +{% note %} + +**Note:** 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. **If you want to link a pull request to an issue using a keyword, the PR must be on the default branch.** + +{% endnote %} + ### About linked issues and pull requests -You can link an issue to a pull request {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.20" %}manually or {% endif %}using a supported keyword in the pull request description. **Important:** this only happens when the PR base branch is the repository default branch (see **Note** below). +You can link an issue to a pull request {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.20" %}manually or {% endif %}using a supported keyword in the pull request description. When you link a pull request to the issue the pull request addresses, collaborators can see that someone is working on the issue. {% if currentVersion ver_lt "enterprise-server@2.21" %}If the pull request and the issue are in different repositories, {% data variables.product.product_name %} will display the link after the pull request is merged, if the person who merges the pull request also has permission to close the issue.{% endif %} @@ -61,13 +67,6 @@ Multiple issues | Use full syntax for each issue | `Resolves #10, resolves #123, You can also use closing keywords in a commit message. The issue will be closed when you merge the commit into the default branch, but the pull request that contains the commit will not be listed as a linked pull request. ---- -**NOTE** - -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. **If you want to link a pull request to an issue using a keyword, the PR must be on the default branch.** - ---- - ### Further reading - "[Autolinked references and URLs](/articles/autolinked-references-and-urls/#issues-and-pull-requests)" From 18b6e8e00b9b35473f79bef12c2003d32e5c6f49 Mon Sep 17 00:00:00 2001 From: Arthur Casals Date: Thu, 15 Oct 2020 11:37:42 +0200 Subject: [PATCH 3/4] Update linking-a-pull-request-to-an-issue.md Updated with requested changes --- .../linking-a-pull-request-to-an-issue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md index 85ed165fe61f..b674f29e5942 100644 --- a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md +++ b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md @@ -43,7 +43,7 @@ You can manually link up to ten issues to each pull request. The issue and pull ### Linking a pull request to an issue using a keyword -You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message. +You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message (please note that the PR must be on the default branch). * close * closes From 037a22bae71202823524d1da2d953fa2c334ed6b Mon Sep 17 00:00:00 2001 From: Arthur Casals Date: Thu, 15 Oct 2020 12:52:20 +0200 Subject: [PATCH 4/4] Update content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md Updated with requested changes Co-authored-by: Felicity Chapman --- .../linking-a-pull-request-to-an-issue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md index b674f29e5942..2c2aa3d5da5c 100644 --- a/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md +++ b/content/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue.md @@ -43,7 +43,7 @@ You can manually link up to ten issues to each pull request. The issue and pull ### Linking a pull request to an issue using a keyword -You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message (please note that the PR must be on the default branch). +You can link a pull request to an issue by using a supported keyword in the pull request's description or in a commit message (please note that the pull request must be on the default branch). * close * closes