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

[PATCH v3 2/6] builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 23, 2013, 06:43 UTC
Message-ID
<1374561800-938-3-git-send-email-gitster@pobox.com>
In-Reply-To
<1374561800-938-1-git-send-email-gitster@pobox.com>

The command line parser of "git push" for "--tags", "--delete", and "--thin" options still used outdated OPT_BOOLEAN. Because these options do not give escalating levels when given multiple times, they should use OPT_BOOL.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/push.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/push.c b/builtin/push.c
index 2d84d10..342d792 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -427,15 +427,15 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 		OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL),
 		OPT_BIT( 0 , "mirror", &flags, N_("mirror all refs"),
 			    (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)),
-		OPT_BOOLEAN( 0, "delete", &deleterefs, N_("delete refs")),
-		OPT_BOOLEAN( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")),
+		OPT_BOOL( 0, "delete", &deleterefs, N_("delete refs")),
+		OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")),
 		OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN),
 		OPT_BIT( 0,  "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN),
 		OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE),
 		{ OPTION_CALLBACK, 0, "recurse-submodules", &flags, N_("check"),
 			N_("control recursive pushing of submodules"),
 			PARSE_OPT_OPTARG, option_parse_recurse_submodules },
-		OPT_BOOLEAN( 0 , "thin", &thin, N_("use thin pack")),
+		OPT_BOOL( 0 , "thin", &thin, N_("use thin pack")),
 		OPT_STRING( 0 , "receive-pack", &receivepack, "receive-pack", N_("receive pack program")),
 		OPT_STRING( 0 , "exec", &receivepack, "receive-pack", N_("receive pack program")),
 		OPT_BIT('u', "set-upstream", &flags, N_("set upstream for git pull/status"),
-- 
1.8.3.4-980-g8decd39
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 14 in “"git push --cas/--lockref" renamed to "--force-with-lease"”
  1. 0/6 "git push --cas/--lockref" renamed to "--force-with-lease"Junio C Hamano, Jul 23, 2013
  2. 1/6 cache.h: move remote/connect API out of itJunio C Hamano, Jul 23, 2013
  3. 2/6 builtin/push.c: use OPT_BOOL, not OPT_BOOLEANJunio C Hamano, Jul 23, 2013
  4. 3/6 remote.c: add command line option parser for "--force-with-lease"Junio C Hamano, Jul 23, 2013
  5. 4/6 push --force-with-lease: implement logic to populate old_sha1_expect[]Junio C Hamano, Jul 23, 2013
  6. 5/6 push --force-with-lease: tie it all togetherJunio C Hamano, Jul 23, 2013
  7. 6/6 t5533: test "push --force-with-lease"Junio C Hamano, Jul 23, 2013
  8. Jakub NarebskiJul 23, 2013
  9. Junio C HamanoJul 23, 2013
  10. Philip OakleyJul 23, 2013
  11. Eric SunshineJul 23, 2013
  12. 7/6 t5540/5541: smart-http does not support "--force-with-lease"Junio C Hamano, Aug 1, 2013
  13. 8/6 send-pack: fix parsing of --force-with-lease optionJunio C Hamano, Aug 2, 2013
  14. 9/6 push: teach --force-with-lease to smart-http transportJunio C Hamano, Aug 2, 2013

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.