Re: [PATCH] git push: remove incomplete options list from help text

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] git push: remove incomplete options list from help text

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:34

Nanako Shiraishi [off-list ref] writes:
quoted hunk
'git push -h' shows usage text with incomplete list of options and then
has a separate list of options that are supported. Imitate the way other
commands (I looked at 'git diff' for an example) show their options.

Signed-off-by: しらいし ななこ <redacted>
---
...
diff --git a/builtin-push.c b/builtin-push.c
index 3cb1ee4..6686b79 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -10,7 +10,7 @@
 #include "parse-options.h"
 
 static const char * const push_usage[] = {
-	"git push [--all | --mirror] [-n | --dry-run] [--porcelain] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]",
+	"git push <options> [<repository> <refspec>...]",
 	NULL,
 };
 
-- 
1.6.5.rc1.18.g53a9a
Sounds like a sane thing to do, but I am sort of surprised that you are
still on 1.6.5-rc1 ;-)

How does this interact with one of the "unapplied patch" you reminded me
of, namely, this one:

    From:	Björn Gustavsson [off-list ref]
    Subject: [PATCH] push: fix usage: --tags is incompatible with --all and --mirror
    Date:	Thu, 15 Oct 2009 18:39:05 +0200
    Message-ID: [off-list ref]

        Correct the usage text to make it clear that --tags cannot
        be combined with --all or --mirror.

The option description that comes from parse-options may need to be
updated as well, no?
    -q, --quiet           be quiet
    -v, --verbose         be verbose
    --repo <repository>   repository
    --all                 push all refs
    --mirror              mirror all refs
    --tags                push tags
    -n, --dry-run         dry run
    --porcelain           machine-readable output
    -f, --force           force updates
    --thin                use thin pack
    --receive-pack <receive-pack>
                          receive pack program
    --exec <receive-pack>
                          receive pack program

[PATCH] git push: say that --tag can't be used with --all or --mirror in help text

From: Nanako Shiraishi <hidden>
Date: 2016-06-15 22:47:34

This replaces an earlier patch by Björn Gustavsson,

  Message-ID: [off-list ref]

Signed-off-by: しらいし ななこ <redacted>
---
 builtin-push.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index 6686b79..d7248f2 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -181,7 +181,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 		OPT_BIT( 0 , "all", &flags, "push all refs", TRANSPORT_PUSH_ALL),
 		OPT_BIT( 0 , "mirror", &flags, "mirror all refs",
 			    (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
-		OPT_BOOLEAN( 0 , "tags", &tags, "push tags"),
+		OPT_BOOLEAN( 0 , "tags", &tags, "push tags (can't be used with --all nor --mirror"),
 		OPT_BIT('n' , "dry-run", &flags, "dry run", TRANSPORT_PUSH_DRY_RUN),
 		OPT_BIT( 0,  "porcelain", &flags, "machine-readable output", TRANSPORT_PUSH_PORCELAIN),
 		OPT_BIT('f', "force", &flags, "force updates", TRANSPORT_PUSH_FORCE),
-- 
1.6.5.rc1.18.g53a9a




-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

Re: [PATCH] git push: say that --tag can't be used with --all or --mirror in help text

From: Jeff King <hidden>
Date: 2016-06-15 22:47:34

On Mon, Oct 19, 2009 at 12:57:01PM +0900, Nanako Shiraishi wrote:
-		OPT_BOOLEAN( 0 , "tags", &tags, "push tags"),
+		OPT_BOOLEAN( 0 , "tags", &tags, "push tags (can't be used with --all nor --mirror"),
Grammar nit: I believe it should be "or" and not "nor".

There is an implicit "either", as in "can't be used with either --all or
--mirror". Saying "can't be used with neither --all nor --mirror" would
be a double-negative. The alternative correct single-negation would be
"can be used with neither --all nor --mirror".

-Peff

Re: [PATCH] git push: say that --tag can't be used with --all or --mirror in help text

From: Jeff King <hidden>
Date: 2016-06-15 22:47:35

On Mon, Oct 19, 2009 at 12:57:01PM +0900, Nanako Shiraishi wrote:
-		OPT_BOOLEAN( 0 , "tags", &tags, "push tags"),
+		OPT_BOOLEAN( 0 , "tags", &tags, "push tags (can't be used with --all nor --mirror"),
Hmm. We apparently all managed to miss this typo. It's visually hard to
notice because of the ")" closing the macro.

-- >8 --
Subject: [PATCH] push: fix typo in usage

Missing ")".

Signed-off-by: Jeff King <redacted>
---
 builtin-push.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index 7d78711..019c986 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -181,7 +181,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 		OPT_BIT( 0 , "all", &flags, "push all refs", TRANSPORT_PUSH_ALL),
 		OPT_BIT( 0 , "mirror", &flags, "mirror all refs",
 			    (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
-		OPT_BOOLEAN( 0 , "tags", &tags, "push tags (can't be used with --all or --mirror"),
+		OPT_BOOLEAN( 0 , "tags", &tags, "push tags (can't be used with --all or --mirror)"),
 		OPT_BIT( 0 , "purge", &flags,
 			"remove locally deleted refs from remote",
 			TRANSPORT_PUSH_PURGE),
-- 
1.6.5.1.139.g6f544.dirty

Re: [PATCH] git push: say that --tag can't be used with --all or --mirror in help text

From: Nanako Shiraishi <hidden>
Date: 2016-06-15 22:47:35

Quoting Jeff King [off-list ref]
On Mon, Oct 19, 2009 at 12:57:01PM +0900, Nanako Shiraishi wrote:
quoted
-		OPT_BOOLEAN( 0 , "tags", &tags, "push tags"),
+		OPT_BOOLEAN( 0 , "tags", &tags, "push tags (can't be used with --all nor --mirror"),
Hmm. We apparently all managed to miss this typo. It's visually hard to
notice because of the ")" closing the macro.
How embarrassing. Thank you for a fix.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help