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

[PATCH] docs: Explain the purpose of fetch's and pull's <refspec> parameter.

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Jun 5, 2014, 15:40 UTC
Message-ID
<1401982803-22346-1-git-send-email-marcnarc@xiplink.com>
In-Reply-To
<53908CE3.6080106@xiplink.com>
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---
 Documentation/git-fetch.txt        |  4 ++--
 Documentation/pull-fetch-param.txt | 17 ++++++++++++++---
 2 files changed, 16 insertions(+), 5 deletions(-)
On 14-06-04 06:17 PM, Junio C Hamano wrote:
Show 8 quoted lines
> 
> Perhaps
> 
>     ... `remote.<repository>.fetch` values are used as the refspecs,
>     i.e. they specify what refs to fetch and what local refs to
>     update.
> 
> or something?

In fact, I like that so much I think it should be *the* description of the <refspec> parameter. Much better than just jumping straight into the syntax.

This patch applies atop your 8/9. I feel strongly that some kind of reference should accompany this description, and your new CONFIGURED REMOTE-TRACKING BRANCHES section seems like a good one for the fetch variant, but since pull's variant doesn't have that section I just made it link to fetch's doc.

(Also, I'm not sure if "CRTB" is a good link ID for your new section.)
		M.
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index 4a735ab..a4cafa3 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -49,8 +49,8 @@ include::pull-fetch-param.txt[]
 include::urls-remotes.txt[]
 
 
-CONFIGURED REMOTE-TRACKING BRANCHES
------------------------------------
+CONFIGURED REMOTE-TRACKING BRANCHES[[CRTB]]
+-------------------------------------------
 
 You would often interact with the same remote repository by
 regularly and repeatedly fetching from it.  In order to keep track
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index 18cffc2..40304c6 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -12,9 +12,20 @@ ifndef::git-pull[]
 endif::git-pull[]
 
 <refspec>::
-	The format of a <refspec> parameter is an optional plus
-	`+`, followed by the source ref <src>, followed
-	by a colon `:`, followed by the destination ref <dst>.
+	Specifies which refs to fetch and which local refs to update.
+	<refspec> parameters are not normally specified on the command
+	line, but instead are read from `remote.<repository>.fetch`
+	configuration variables
+ifndef::git-pull[]
+	(see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below).
+endif::git-pull[]
+ifdef::git-pull[]
+	(see linkgit:git-fetch[1]).
+endif::git-pull[]
++
+The format of a <refspec> parameter is an optional plus
+`+`, followed by the source ref <src>, followed
+by a colon `:`, followed by the destination ref <dst>.
 +
 The remote ref that matches <src>
 is fetched, and if <dst> is not empty string, the local
-- 
2.0.0.dirty
Previous: Marc BranchaudNext: Junio C Hamano
Message 16 of 24 in “Clarify two uses of remote.*.fetch”
  1. 0/9 Clarify two uses of remote.*.fetchJunio C Hamano, Jun 3, 2014
  2. 1/9 fetch doc: update introductory part for clarityJunio C Hamano, Jun 3, 2014
  3. 2/9 fetch doc: move FETCH_HEAD material lower and add an exampleJunio C Hamano, Jun 3, 2014
  4. 3/9 fetch doc: update note on '+' in front of the refspecJunio C Hamano, Jun 3, 2014
  5. Michael HaggertyJun 18, 2014
  6. 4/9 fetch doc: remove notes on outdated "mixed layout"Junio C Hamano, Jun 3, 2014
  7. 5/9 fetch doc: on pulling multiple refspecsJunio C Hamano, Jun 3, 2014
  8. Marc BranchaudJun 4, 2014
  9. 6/9 fetch doc: update refspec format descriptionJunio C Hamano, Jun 3, 2014
  10. 7/9 fetch doc: remove "short-cut" sectionJunio C Hamano, Jun 3, 2014
  11. Marc BranchaudJun 4, 2014
  12. 8/9 fetch doc: add a section on configured remote-tracking branchesJunio C Hamano, Jun 3, 2014
  13. Marc BranchaudJun 4, 2014
  14. Junio C HamanoJun 4, 2014
  15. Marc BranchaudJun 5, 2014
  16. docs: Explain the purpose of fetch's and pull's <refspec> parameter.Marc Branchaud, Jun 5, 2014
  17. Junio C HamanoJun 5, 2014
  18. docs: Explain the purpose of fetch's and pull's <refspec> parameter.Marc Branchaud, Jun 11, 2014
  19. 9/9 fetch: allow explicit --refmap to override configurationJunio C Hamano, Jun 3, 2014
  20. Marc BranchaudJun 4, 2014
  21. Junio C HamanoJun 4, 2014
  22. Marc BranchaudJun 5, 2014
  23. Junio C HamanoJun 5, 2014
  24. Michael HaggertyJun 18, 2014

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.