From: Junio C Hamano Date: Mon, 15 Mar 2010 07:58:42 +0000 (-0700) Subject: Merge branch 'tc/transport-verbosity' X-Git-Tag: v1.7.1-rc0~66 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=53997a30f8138f41d1d9c7a45e84106cc21c0558;p=git.git 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 --- 53997a30f8138f41d1d9c7a45e84106cc21c0558 diff --cc Documentation/git-push.txt index 49b6bd9d9,8d957244b..59dc8b197 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@@ -141,11 -141,16 +141,17 @@@ useful if you write an alias or script --thin:: --no-thin:: - These options are passed to 'git send-pack'. Thin - transfer spends extra cycles to minimize the number of - objects to be sent and meant to be used on slower connection. + These options are passed to linkgit:git-send-pack[1]. A thin transfer + significantly reduces the amount of sent data when the sender and + receiver share many of the same objects in common. The default is + \--thin. + -q:: + --quiet:: + Suppress all output, including the listing of updated refs, + unless an error occurs. Progress is not reported to the standard + error stream. + -v:: --verbose:: Run verbosely. diff --cc transport.c index 825be9456,e2cfabd7e..8ce39364a --- a/transport.c +++ b/transport.c @@@ -786,10 -788,9 +786,10 @@@ static int git_transport_push(struct tr 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); + args.porcelain = !!(flags & TRANSPORT_PUSH_PORCELAIN); ret = send_pack(&args, data->fd, data->conn, remote_refs, &data->extra_have); @@@ -1046,11 -1052,11 +1067,11 @@@ int transport_push(struct transport *tr 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; + int push_ret, ret, err; if (flags & TRANSPORT_PUSH_ALL) match_flags |= MATCH_REFS_ALL; diff --cc transport.h index 096f6e947,d9bbabba0..c59d97388 --- a/transport.h +++ b/transport.h @@@ -94,12 -93,9 +99,11 @@@ struct transport #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 + #define TRANSPORT_PUSH_PORCELAIN 16 + #define TRANSPORT_PUSH_SET_UPSTREAM 32 + +#define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3) + /* Returns a transport suitable for the url */ struct transport *transport_get(struct remote *, const char *);