summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bde873c)
raw | patch | inline | side by side (parent: bde873c)
author | Tay Ray Chuan <rctay89@gmail.com> | |
Wed, 24 Feb 2010 12:50:24 +0000 (20:50 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Feb 2010 16:35:44 +0000 (08:35 -0800) |
Remove the flags TRANSPORT_PUSH_QUIET and TRANSPORT_PUSH_VERBOSE; use
transport->verbose instead to determine verbosity for pushing.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport->verbose instead to determine verbosity for pushing.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-push.c | patch | blob | history | |
transport-helper.c | patch | blob | history | |
transport.c | patch | blob | history | |
transport.h | patch | blob | history |
diff --git a/builtin-push.c b/builtin-push.c
index 5633f0ade49f7c845665b7aab202be18a8cc9d8d..0082dadb73fb0767dd1e69001e485a2cbca6bf13 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
static int thin;
static int deleterefs;
static const char *receivepack;
+static int verbosity;
static const char **refspec;
static int refspec_nr;
{
int err;
int nonfastforward;
+
+ transport_set_verbosity(transport, verbosity);
+
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);
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",
diff --git a/transport-helper.c b/transport-helper.c
index 107742891f6e68d4b103f61a425a585770b0d155..3d33697a4b2ee881dcd2ed7237bc2945b859e04d 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
if (buf.len == 0)
return 0;
- transport->verbose = flags & TRANSPORT_PUSH_VERBOSE ? 1 : 0;
standard_options(transport);
if (flags & TRANSPORT_PUSH_DRY_RUN) {
diff --git a/transport.c b/transport.c
index 1632c4d0aab3195ee79a60b5dc44ab7c29cc10a4..0655f65c1b530127f6a044f5102ffa58b2d32d20 100644 (file)
--- a/transport.c
+++ b/transport.c
@@ -788,8 +788,8 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
args.send_mirror = !!(flags & TRANSPORT_PUSH_MIRROR);
args.force_update = !!(flags & TRANSPORT_PUSH_FORCE);
args.use_thin_pack = data->options.thin;
- args.verbose = !!(flags & TRANSPORT_PUSH_VERBOSE);
- args.quiet = !!(flags & TRANSPORT_PUSH_QUIET);
+ args.verbose = (transport->verbose > 0);
+ args.quiet = (transport->verbose < 0);
args.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN);
ret = send_pack(&args, data->fd, data->conn, remote_refs,
transport->get_refs_list(transport, 1);
struct ref *local_refs = get_local_heads();
int match_flags = MATCH_REFS_NONE;
- int verbose = flags & TRANSPORT_PUSH_VERBOSE;
- int quiet = flags & TRANSPORT_PUSH_QUIET;
+ int verbose = (transport->verbose > 0);
+ int quiet = (transport->verbose < 0);
int porcelain = flags & TRANSPORT_PUSH_PORCELAIN;
int pretend = flags & TRANSPORT_PUSH_DRY_RUN;
int ret, err;
diff --git a/transport.h b/transport.h
index 7d1a0b6b36dcf5cf4f7199fdb9e588441b849228..c0743b1086edef60452d98711e52ad2240c79680 100644 (file)
--- a/transport.h
+++ b/transport.h
#define TRANSPORT_PUSH_FORCE 2
#define TRANSPORT_PUSH_DRY_RUN 4
#define TRANSPORT_PUSH_MIRROR 8
-#define TRANSPORT_PUSH_VERBOSE 16
#define TRANSPORT_PUSH_PORCELAIN 32
-#define TRANSPORT_PUSH_QUIET 64
#define TRANSPORT_PUSH_SET_UPSTREAM 128
/* Returns a transport suitable for the url */