git-pull.txt: correct outdated example + link to specific 'git fetch' section
cover git-pull.txt: correct outdated example + link to specific 'git fetch' section
I was reading the git pull documentation and discovered an outdated example description. While reading the git fetch documentation to confirm the behaviour described ingit pull was indeed wrong, I figured it would be easier to refer directly to the "Configured remote-tracking branches" section in git fetch from the git pull documentation, just as in git fetch.
Philippe Blain (2):
pull doc: refer to a specific section in 'fetch' doc pull doc: correct outdated description of an example
Documentation/git-pull.txt | 6 +++--- Documentation/pull-fetch-param.txt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-)
base-commit: 9fadedd637b312089337d73c3ed8447e9f0aa775
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-751%2Fphil-blain%2Fdoc-pull-update-remote-tracking-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-751/phil-blain/doc-pull-update-remote-tracking-v1
Pull-Request: https://github.com/git/git/pull/751
Signature · 1 line
gitgitgadget
PATCH 1/2 pull doc: refer to a specific section in 'fetch' doc
From: Philippe Blain <[email protected]>
The documentation for the <refspec> parameter in the git fetch documentation refers to the section "CONFIGURED REMOTE-TRACKING BRANCHES" in this same documentation page.
In the git pull documentation, let's also refer specifically to this section instead of just linking to the git fetch documentation.
--- Documentation/pull-fetch-param.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/pull-fetch-param.txt +2 -1
@@ -19,7 +19,8 @@ ifndef::git-pull[] (see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below). endif::git-pull[] ifdef::git-pull[] - (see linkgit:git-fetch[1]). + (see the section "CONFIGURED REMOTE-TRACKING BRANCHES" + in linkgit:git-fetch[1]). endif::git-pull[] + The format of a <refspec> parameter is an optional plus
Signature · 1 line
gitgitgadget
Re: [PATCH 1/2] pull doc: refer to a specific section in 'fetch' doc
Quoted 8 lines · Philippe Blain via GitGitGadget
From: Philippe Blain <[email protected]>
The documentation for the
<refspec>parameter in thegit fetchdocumentation refers to the section "CONFIGURED REMOTE-TRACKING BRANCHES" in this same documentation page.In the
git pulldocumentation, let's also refer specifically to this section instead of just linking to thegit fetchdocumentation.
Makes sense. One thought:
Documentation/pull-fetch-param.txt ifndef::git-pull[] · line 24
Quoted 12 lines
Documentation/pull-fetch-param.txt +2
-1@@ -19,7 +19,8 @@ ifndef::git-pull[] (see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below). endif::git-pull[] ifdef::git-pull[] - (see linkgit:git-fetch[1]). + (see the section "CONFIGURED REMOTE-TRACKING BRANCHES" + in linkgit:git-fetch[1]). endif::git-pull[]
We can hyperlink directly to this section with the CRTB tag (as you can see in the context above). But I guess we don't have a portable macro to do so across different manpages. Assuming we'd need something like linkgit to accomplish, it's best not to hold up this change waiting for that.
-Peff
Re: [PATCH 1/2] pull doc: refer to a specific section in 'fetch' doc
Hi Peff,
Quoted 14 lines · Jeff King
One thought:
Quoted 10 lines
Documentation/pull-fetch-param.txt +0
-0@@ -19,7 +19,8 @@ ifndef::git-pull[] (see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below).endif::git-pull[]
ifdef::git-pull[]Documentation/pull-fetch-param.txt +1
-1- (see linkgit:git-fetch[1]). + (see the section "CONFIGURED REMOTE-TRACKING BRANCHES"
Quoted 8 lines
Quoted 2 lines
Documentation/pull-fetch-param.txt +1
-0+ in linkgit:git-fetch[1]).endif::git-pull[]
We can hyperlink directly to this section with the CRTB tag (as you can see in the context above). But I guess we don't have a portable macro to do so across different manpages. Assuming we'd need something like linkgit to accomplish, it's best not to hold up this change waiting for that.
I didn't know it was possible. I agree that cross-linking directly to a specific section would be great, especially if it would work for the manpages, the HTML documentation as well as the website!
Philippe.
PATCH 2/2 pull doc: correct outdated description of an example
In reply to Philippe Blain via GitGitGadgetFrom: Philippe Blain <[email protected]>
Since f269048754 (fetch: opportunistically update tracking refs, 2013-05-11), the underlying git fetch in git pull <remote> <branch> updates the configured remote-tracking branch for <branch>.
However, an example in the 'Examples' section of the git pull documentation still states that this is not the case.
Correct the description of this example.
--- Documentation/git-pull.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Documentation/git-pull.txt +3 -3
@@ -229,9 +229,9 @@ branch.<name>.merge options; see linkgit:git-config[1] for details. $ git pull origin next ------------------------------------------------ + -This leaves a copy of `next` temporarily in FETCH_HEAD, but -does not update any remote-tracking branches. Using remote-tracking -branches, the same can be done by invoking fetch and merge: +This leaves a copy of `next` temporarily in FETCH_HEAD, and +updates the remote-tracking branch `origin/next`. +The same can be done by invoking fetch and merge: + ------------------------------------------------ $ git fetch origin
Signature · 1 line
gitgitgadget
Re: [PATCH 2/2] pull doc: correct outdated description of an example
Quoted 10 lines · Philippe Blain via GitGitGadget
From: Philippe Blain <[email protected]>
Since
f269048754(fetch: opportunistically update tracking refs, 2013-05-11), the underlyinggit fetchingit pull <remote> <branch>updates the configured remote-tracking branch for <branch>.However, an example in the 'Examples' section of the
git pulldocumentation still states that this is not the case.Correct the description of this example.
Yeah, I think the example just never got updated. Your patch looks good.
Another option would be to use a direct URL rather than a configured remote, which really would just update FETCH_HEAD. But I don't think the handling of remote-tracking branches is central to this example either way, so your minimal change is better.
-Peff