summaryrefslogtreecommitdiff
path: root/builtin/push.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-15 07:58:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-15 07:58:42 (GMT)
commit53997a30f8138f41d1d9c7a45e84106cc21c0558 (patch)
tree656769918ccf2ffce554de623edb4a24e990d89e /builtin/push.c
parent66bce02ec459123d07c3f0230906cc2f8e36504c (diff)
parent212cfe157effe53537ec42f156fbf7415441efd0 (diff)
downloadgit-53997a30f8138f41d1d9c7a45e84106cc21c0558.zip
git-53997a30f8138f41d1d9c7a45e84106cc21c0558.tar.gz
git-53997a30f8138f41d1d9c7a45e84106cc21c0558.tar.bz2
Merge branch 'tc/transport-verbosity'
* tc/transport-verbosity: transport: update flags to be in running order fetch and pull: learn --progress push: learn --progress transport->progress: use flag authoritatively clone: support multiple levels of verbosity push: support multiple levels of verbosity fetch: refactor verbosity option handling into transport.[ch] Documentation/git-push: put --quiet before --verbose Documentation/git-pull: put verbosity options before merge/fetch ones Documentation/git-clone: mention progress in -v Conflicts: transport.h
Diffstat (limited to 'builtin/push.c')
-rw-r--r--builtin/push.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/builtin/push.c b/builtin/push.c
index 235ca12..62957ed 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -17,6 +17,8 @@ static const char * const push_usage[] = {
static int thin;
static int deleterefs;
static const char *receivepack;
+static int verbosity;
+static int progress;
static const char **refspec;
static int refspec_nr;
@@ -105,13 +107,16 @@ static int push_with_options(struct transport *transport, int flags)
{
int err;
int nonfastforward;
+
+ transport_set_verbosity(transport, verbosity, progress);
+
if (receivepack)
transport_set_option(transport,
TRANS_OPT_RECEIVEPACK, receivepack);
if (thin)
transport_set_option(transport, TRANS_OPT_THIN, "yes");
- if (flags & TRANSPORT_PUSH_VERBOSE)
+ if (verbosity > 0)
fprintf(stderr, "Pushing to %s\n", transport->url);
err = transport_push(transport, refspec_nr, refspec, flags,
&nonfastforward);
@@ -204,8 +209,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
int rc;
const char *repo = NULL; /* default repository */
struct option options[] = {
- OPT_BIT('q', "quiet", &flags, "be quiet", TRANSPORT_PUSH_QUIET),
- OPT_BIT('v', "verbose", &flags, "be verbose", TRANSPORT_PUSH_VERBOSE),
+ OPT__VERBOSITY(&verbosity),
OPT_STRING( 0 , "repo", &repo, "repository", "repository"),
OPT_BIT( 0 , "all", &flags, "push all refs", TRANSPORT_PUSH_ALL),
OPT_BIT( 0 , "mirror", &flags, "mirror all refs",
@@ -220,6 +224,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
OPT_STRING( 0 , "exec", &receivepack, "receive-pack", "receive pack program"),
OPT_BIT('u', "set-upstream", &flags, "set upstream for git pull/status",
TRANSPORT_PUSH_SET_UPSTREAM),
+ OPT_BOOLEAN(0, "progress", &progress, "force progress reporting"),
OPT_END()
};