threads / patch / 53166

patch, 2 partsgit-pull.txt: correct outdated example + link to specific 'git fetch' section

Subject: [PATCH 0/2] git-pull.txt: correct outdated example + link to specific 'git fetch' section

## tl;dr

6 messages between Apr 5, 2020 and Apr 16, 2020. Diffs are folded; open one to read it.

replies: 5people: 2as markdown or json

Philippe Blain via GitGitGadget· Apr 5, 2020, 15:50 UTC · lore

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
-- 
gitgitgadget
Philippe Blain via GitGitGadget· Apr 5, 2020, 15:50 UTC · re: Philippe Blain via GitGitGadget · lore

[PATCH 1/2] pull doc: refer to a specific section in 'fetch' doc

From: Philippe Blain <levraiphilippeblain@gmail.com>

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.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/pull-fetch-param.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Show changes to Documentation/pull-fetch-param.txt +2 −1
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index 7d3a60f5b93..95ea8499029 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -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
-- 
gitgitgadget
Jeff King· Apr 6, 2020, 20:19 UTC · re: Philippe Blain via GitGitGadget · lore

Re: [PATCH 1/2] pull doc: refer to a specific section in 'fetch' doc

On Sun, Apr 05, 2020 at 03:50:18PM +0000, Philippe Blain via GitGitGadget wrote:
Show 8 quoted lines
> From: Philippe Blain <levraiphilippeblain@gmail.com>
> 
> 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.
Makes sense. One thought:
Show 12 quoted lines
> diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
> index 7d3a60f5b93..95ea8499029 100644
> --- a/Documentation/pull-fetch-param.txt
> +++ b/Documentation/pull-fetch-param.txt
> @@ -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
Philippe Blain· Apr 16, 2020, 12:39 UTC · re: Jeff King · lore

Re: [PATCH 1/2] pull doc: refer to a specific section in 'fetch' doc

Hi Peff,
Show 22 quoted lines
> Le 6 avr. 2020 à 16:19, Jeff King <peff@peff.net> a écrit :
> 
> One thought:
> 
>> diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
>> index 7d3a60f5b93..95ea8499029 100644
>> --- a/Documentation/pull-fetch-param.txt
>> +++ b/Documentation/pull-fetch-param.txt
>> @@ -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.

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.
Philippe Blain via GitGitGadget· Apr 5, 2020, 15:50 UTC · re: Philippe Blain via GitGitGadget · lore

[PATCH 2/2] pull doc: correct outdated description of an example

From: Philippe Blain <levraiphilippeblain@gmail.com>

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.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/git-pull.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Show changes to Documentation/git-pull.txt +3 −3
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index dfb901f8b83..21e10905fa2 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -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
-- 
gitgitgadget
Jeff King· Apr 6, 2020, 20:22 UTC · re: Philippe Blain via GitGitGadget · lore

Re: [PATCH 2/2] pull doc: correct outdated description of an example

On Sun, Apr 05, 2020 at 03:50:19PM +0000, Philippe Blain via GitGitGadget wrote:
Show 10 quoted lines
> From: Philippe Blain <levraiphilippeblain@gmail.com>
> 
> 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.
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

← back to recent threads