From: Junio C Hamano Date: Sun, 5 Nov 2006 01:18:29 +0000 (-0800) Subject: Merge branch 'lt/push-config' X-Git-Tag: v1.4.4-rc1~19 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/66fd23153ae84df505f81b4816f54a62a467378f?ds=inline;hp=-c Merge branch 'lt/push-config' * lt/push-config: git push: add verbose flag and allow overriding of default target repository Allow '-' in config variable names --- 66fd23153ae84df505f81b4816f54a62a467378f diff --combined builtin-push.c index 5f7eccf14b,3151fb790d..d23974e708 --- a/builtin-push.c +++ b/builtin-push.c @@@ -10,7 -10,7 +10,7 @@@ static const char push_usage[] = "git-push [--all] [--tags] [-f | --force] [...]"; - static int all, tags, force, thin = 1; + static int all, tags, force, thin = 1, verbose; static const char *execute; #define BUF_SIZE (2084) @@@ -27,7 -27,7 +27,7 @@@ static void add_refspec(const char *ref refspec_nr = nr; } -static int expand_one_ref(const char *ref, const unsigned char *sha1) +static int expand_one_ref(const char *ref, const unsigned char *sha1, int flag, void *cb_data) { /* Ignore the "refs/" at the beginning of the refname */ ref += 5; @@@ -51,7 -51,7 +51,7 @@@ static void expand_refspecs(void } if (!tags) return; - for_each_ref(expand_one_ref); + for_each_ref(expand_one_ref, NULL); } static void set_refspecs(const char **refs, int nr) @@@ -248,6 -248,8 +248,8 @@@ static int do_push(const char *repo while (dest_refspec_nr--) argv[dest_argc++] = *dest_refspec++; argv[dest_argc] = NULL; + if (verbose) + fprintf(stderr, "Pushing to %s\n", dest); err = run_command_v(argc, argv); if (!err) continue; @@@ -281,6 -283,14 +283,14 @@@ int cmd_push(int argc, const char **arg i++; break; } + if (!strcmp(arg, "-v")) { + verbose=1; + continue; + } + if (!strncmp(arg, "--repo=", 7)) { + repo = arg+7; + continue; + } if (!strcmp(arg, "--all")) { all = 1; continue;