git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/4] doc: git-pull: move <repository> and <refspec> params

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Sep 24, 2025, 20:17 UTC
Message-ID
<CALnO6CCQhTR77nvjPM-fhTm9o6imjw9Erk0NMWhLMYrSAWW8hw@mail.gmail.com>
In-Reply-To
<f69d2e6fabbace9ae76cb3822b063a3f19622138.1758656702.git.gitgitgadget@gmail.com>

On Tue, Sep 23, 2025 at 3:45 PM Julia Evans via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 7 quoted lines
>
> From: Julia Evans <julia@jvns.ca>
>
> From user feedback:
>
> - it's confusing that we use both <branch> and <refspec> to refer to the
>   second argument
Yep.
> - one user is not clear about what `refs/heads/*:refs/remotes/origin/*`
>   is meant to be an example of ("is it like a path?")

Also yep, since the deleted text doesn't contain any pointers to learn what a refspec is.

Show 10 quoted lines
> The DESCRIPTION section is also doing a lot right now: it's trying to
> describe both how the <repository> and <refspec> arguments work (which
> is pretty complex, as seen in the DEFAULT BEHAVIOUR section)
> as well as how `git pull` calls `git fetch` and merge/rebase/etc
> depending on the arguments.
>
> Handle this by moving the description of the <repository> and <refspec>
> arguments to the OPTIONS section, so that we can focus on the
> merge/rebase/etc behaviour in the DESCRIPTION section, and refer folks
> to the later sections for details.

I generally like this: it makes things a bit more consistent, even though "options" isn't quite how I think of these (optional!) positional parameters. Still, I generally jump down to the <arg> sections (like in git-push(1)) to learn what I can do with those.

> Use the term "upstream" instead of 'the "remote" and "merge"
> configuration for the current branch' since users are more likely to
> know what an "upstream" is.
With the upstream section, great.
Show 18 quoted lines
> diff --git a/Documentation/git-pull.adoc b/Documentation/git-pull.adoc
> index 48e924a10a..50af7fde81 100644
> --- a/Documentation/git-pull.adoc
> +++ b/Documentation/git-pull.adoc
> @@ -27,17 +27,6 @@ and then depending on configuration options or command line flags,
>  will call either `git rebase` or `git merge` to reconcile diverging
>  branches.
>
> -<repository> should be the name of a remote repository as
> -passed to linkgit:git-fetch[1].  <refspec> can name an
> -arbitrary remote ref (for example, the name of a tag) or even
> -a collection of refs with corresponding remote-tracking branches
> -(e.g., refs/heads/{asterisk}:refs/remotes/origin/{asterisk}),
> -but usually it is the name of a branch in the remote repository.
> -
> -Default values for <repository> and <branch> are read from the
> -"remote" and "merge" configuration for the current branch
> -as set by linkgit:git-branch[1] `--track`.

And we don't even mind losing "--track" here because we cover it in Upstream Branches (e.g., https://lore.kernel.org/git/3ecfb5c3a67723f160e8161e212d77f95964539c.1758649472.git.gitgitgadget@gmail.com/).

Show 26 quoted lines
> -
>  Assume the following history exists and the current branch is
>  "`master`":
>
> @@ -77,6 +66,24 @@ pulling or stash them away with linkgit:git-stash[1].
>  OPTIONS
>  -------
>
> +<repository>::
> +       The "remote" repository to pull from.  This can be either
> +       a URL (see the section <<URLS,GIT URLS>> below) or the name
> +       of a remote (see the section <<REMOTES,REMOTES>> below).
> ++
> +Defaults to the configured upstream for the current branch, or `origin`.
> +See UPSTREAM BRANCHES below for more on how to configure upstreams.
> +
> +<refspec>::
> +       Which branch or other reference(s) to fetch and integrate into the
> +       current branch, for example `main` in `git pull origin main`.
> +       Defaults to the configured upstream for the current branch.
> ++
> +This can be a branch, tag, or other collection of reference(s).
> +See <refspec> below under "Options related to fetching" for the full syntax,
> +and DEFAULT BEHAVIOUR below for how `git pull` uses this argument to
> +determine which remote branch to integrate.
> +

I think these are covered in Documentation/pull-fetch-param.adoc, which I only found by looking at "git help pull" and searching for the URLs references, hah.

Anyway, the existing explanations are far too late in the manual (Vim says ~46%, 960 lines down, when rendered with MANWIDTH=80). Moving them up is a good idea, but maybe we need to do that in a way that jives with the later "fetching" section. Hm.

-- 
D. Ben Knoble
Previous: Julia Evans via GitGitGadgetNext: Julia Evans
Message 3 of 32 in “doc: git-pull: clarify DESCRIPTION section”
  1. 0/4 doc: git-pull: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Sep 23, 2025
  2. 1/4 doc: git-pull: move <repository> and <refspec> paramsJulia Evans via GitGitGadget, Sep 23, 2025
  3. D. Ben KnobleSep 24, 2025
  4. Julia EvansOct 7, 2025
  5. 2/4 doc: git-pull: clarify options for integrating remote branchJulia Evans via GitGitGadget, Sep 23, 2025
  6. D. Ben KnobleSep 24, 2025
  7. Julia EvansSep 24, 2025
  8. Chris TorekSep 24, 2025
  9. Julia EvansOct 6, 2025
  10. 3/4 doc: git-pull: delete the exampleJulia Evans via GitGitGadget, Sep 23, 2025
  11. 4/4 doc: git-pull: clarify how to exit a conflicted mergeJulia Evans via GitGitGadget, Sep 23, 2025
  12. Julia EvansSep 24, 2025
  13. D. Ben KnobleSep 24, 2025
  14. Julia EvansOct 7, 2025
  15. Ben KnobleOct 10, 2025
  16. D. Ben KnobleSep 24, 2025
  17. 0/4 doc: git-pull: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Oct 8, 2025
  18. 1/4 doc: git-pull: move <repository> and <refspec> paramsJulia Evans via GitGitGadget, Oct 8, 2025
  19. 2/4 doc: git-pull: clarify options for integrating remote branchJulia Evans via GitGitGadget, Oct 8, 2025
  20. Junio C HamanoOct 8, 2025
  21. Julia EvansOct 9, 2025
  22. Kristoffer HaugsbakkOct 9, 2025
  23. Junio C HamanoOct 9, 2025
  24. 3/4 doc: git-pull: delete the exampleJulia Evans via GitGitGadget, Oct 8, 2025
  25. 4/4 doc: git-pull: clarify how to exit a conflicted mergeJulia Evans via GitGitGadget, Oct 8, 2025
  26. 0/4 doc: git-pull: clarify DESCRIPTION sectionJulia Evans via GitGitGadget, Oct 15, 2025
  27. 1/4 doc: git-pull: move <repository> and <refspec> paramsJulia Evans via GitGitGadget, Oct 15, 2025
  28. 2/4 doc: git-pull: clarify options for integrating remote branchJulia Evans via GitGitGadget, Oct 15, 2025
  29. 3/4 doc: git-pull: delete the exampleJulia Evans via GitGitGadget, Oct 15, 2025
  30. 4/4 doc: git-pull: clarify how to exit a conflicted mergeJulia Evans via GitGitGadget, Oct 15, 2025
  31. Ben KnobleOct 15, 2025
  32. Junio C HamanoOct 15, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.