Git development
 help / color / mirror / Atom feed
* [DOC-PATCH] Clarify description of <repository> argument to pull/fetch for naming remotes.
@ 2008-05-28 14:59 John J. Franey
  2008-05-28 19:21 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: John J. Franey @ 2008-05-28 14:59 UTC (permalink / raw)
  To: git, gitster



Signed-off-by: John J. Franey <jjfraney@gmail.com>
---
 Here is proposal for the git-fetch(1) and git-pull(1)
 man pages.  As a newbie, I found the original a bit
 too awkward to understand readily.  I hope this is
 helpful.

 Alter description of <repository> in OPTIONS section to
 explicitly state that a 'remote name' is accepted.

 Rewrite REMOTES section to more directly identify the
 different kinds of remotes permitted.

 Documentation/pull-fetch-param.txt |    4 ++-
 Documentation/urls-remotes.txt     |   65 ++++++++++++++++++++---------------
 2 files changed, 40 insertions(+), 29 deletions(-)

diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index b6eb7fc..cbee369 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -1,6 +1,8 @@
 <repository>::
 	The "remote" repository that is the source of a fetch
-	or pull operation.  See the section <<URLS,GIT URLS>> below.
+	or pull operation.  This parameter can be either a URL
+	(see the section <<URLS,GIT URLS>> below) or the name
+	of a remote (see the section <<REMOTES,REMOTES>> below).
 
 <refspec>::
 	The canonical format of a <refspec> parameter is
diff --git a/Documentation/urls-remotes.txt b/Documentation/urls-remotes.txt
index 5dd1f83..31e542d 100644
--- a/Documentation/urls-remotes.txt
+++ b/Documentation/urls-remotes.txt
@@ -1,11 +1,21 @@
 include::urls.txt[]
 
-REMOTES
--------
+REMOTES[[REMOTES]]
+------------------
 
-In addition to the above, as a short-hand, the name of a
-file in `$GIT_DIR/remotes` directory can be given; the
-named file should be in the following format:
+The name of one of the following can be used instead of a URL as <repository> argument:
+
+* a file in the `$GIT_DIR/remotes` directory,
+* a remote in the git configuration file: `$GIT_DIR/config`, or
+* a file in the `$GIT_DIR/branches` directory.
+
+
+
+Named files in `$GIT_DIR/remotes`
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If <repository> is the name of a file in the `$GIT_DIR/remotes` directory,
+the file should have the following format:
 
 ------------
 	URL: one of the above URL format
@@ -14,15 +24,16 @@ named file should be in the following format:
 
 ------------
 
-Then such a short-hand is specified in place of
-<repository> without <refspec> parameters on the command
-line, <refspec> specified on `Push:` lines or `Pull:`
-lines are used for `git-push` and `git-fetch`/`git-pull`,
-respectively.  Multiple `Push:` and `Pull:` lines may
+`Push:` lines are used by `git-push` and
+`Pull:` lines are used by `git-pull` and `git-fetch`.
+Multiple `Push:` and `Pull:` lines may
 be specified for additional branch mappings.
 
-Or, equivalently, in the `$GIT_DIR/config` (note the use
-of `fetch` instead of `Pull:`):
+Named remote in configuration file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If <repository> is the name of a remote entry in the git configuration file,
+the entry might look like this:
 
 ------------
 	[remote "<remote>"]
@@ -32,24 +43,22 @@ of `fetch` instead of `Pull:`):
 
 ------------
 
-The name of a file in `$GIT_DIR/branches` directory can be
-specified as an older notation short-hand; the named
-file should contain a single line, a URL in one of the
-above formats, optionally followed by a hash `#` and the
-name of remote head (URL fragment notation).
-`$GIT_DIR/branches/<remote>` file that stores a <url>
-without the fragment is equivalent to have this in the
-corresponding file in the `$GIT_DIR/remotes/` directory.
+Note the use of `fetch` instead of `Pull:` (a distinction from the format described above).
+See linkgit:git-remote[1] or linkgit:git-config[1] for details.
 
-------------
-	URL: <url>
-	Pull: refs/heads/master:<remote>
-
-------------
+Named file in `$GIT_DIR/branches`
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-while having `<url>#<head>` is equivalent to
+If <repository> is the name of a file in the `$GIT_DIR/branches` directory,
+the file should have the following format,
+on a single line:
 
 ------------
-	URL: <url>
-	Pull: refs/heads/<head>:<remote>
+	<url>#<head>
 ------------
+
+This line contains a URL in one of the above formats,
+optionally followed by a hash `#` and the
+name of remote head (URL fragment notation).
+'master' is default in case the hash and remote head are omitted.
+
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-29  1:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 14:59 [DOC-PATCH] Clarify description of <repository> argument to pull/fetch for naming remotes John J. Franey
2008-05-28 19:21 ` Junio C Hamano
2008-05-29  1:43   ` John J. Franey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox