Skip to contentSkip to conversation

fetch/push: fix usage strings

PATCH New Tay Ray Chuan 1 participant 1 message Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch/push: fix usage strings

- use "<options>" instead of just "options".
- use "[<repository> [<refspec>...]]" to indicate that <repository> and <refspec> are optional, and that <refspec> cannot be specified without specifying <repository>.

Note that when called without specifying <repository> (eg. "git fetch -f"), it is accurate to say that the "git fetch [<options>] [<repository> ...]" case takes precedence over "git fetch [<options>] <group>".

---

Related to, but does not depend on, the recent ls-remote patch.

 Documentation/git-fetch.txt |    8 ++++----
 Documentation/git-push.txt  |    2 +-
 builtin/fetch.c             |    8 ++++----
 builtin/push.c              |    2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)
Documentation/git-fetch.txt +4 -4
index 948ea26..400fe7f 100644
@@ -8,13 +8,13 @@ git-fetch - Download objects and refs from another repository
 
 SYNOPSIS
 --------
-'git fetch' <options> <repository> <refspec>...
+'git fetch' [<options>] [<repository> [<refspec>...]]
 
-'git fetch' <options> <group>
+'git fetch' [<options>] <group>
 
-'git fetch' --multiple <options> [<repository> | <group>]...
+'git fetch' --multiple [<options>] [<repository> | <group>]...
 
-'git fetch' --all <options>
+'git fetch' --all [<options>]
 
 
 DESCRIPTION
Documentation/git-push.txt +1 -1
index 59dc8b1..4857024 100644
@@ -11,7 +11,7 @@ SYNOPSIS
 [verse]
 'git push' [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
 	   [--repo=<repository>] [-f | --force] [-v | --verbose] [-u | --set-upstream]
-	   [<repository> <refspec>...]
+	   [<repository> [<refspec>...]]
 
 DESCRIPTION
 -----------
builtin/fetch.c +4 -4
index 957be9f..8470850 100644
@@ -14,10 +14,10 @@
 #include "transport.h"
 
 static const char * const builtin_fetch_usage[] = {
-	"git fetch [options] [<repository> <refspec>...]",
-	"git fetch [options] <group>",
-	"git fetch --multiple [options] [<repository> | <group>]...",
-	"git fetch --all [options]",
+	"git fetch [<options>] [<repository> [<refspec>...]]",
+	"git fetch [<options>] <group>",
+	"git fetch --multiple [<options>] [<repository> | <group>]...",
+	"git fetch --all [<options>]",
 	NULL
 };
 
builtin/push.c +1 -1
index 62957ed..f4358b9 100644
@@ -10,7 +10,7 @@
 #include "parse-options.h"
 
 static const char * const push_usage[] = {
-	"git push [<options>] [<repository> <refspec>...]",
+	"git push [<options>] [<repository> [<refspec>...]]",
 	NULL,
 };
 

--
1.6.6.1368.g82eeb