aboutsummaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-15 00:58:42 -0700
committerJunio C Hamano <gitster@pobox.com>2010-03-15 00:58:42 -0700
commit53997a30f8138f41d1d9c7a45e84106cc21c0558 (patch)
tree656769918ccf2ffce554de623edb4a24e990d89e /builtin/clone.c
parent66bce02ec459123d07c3f0230906cc2f8e36504c (diff)
parent212cfe157effe53537ec42f156fbf7415441efd0 (diff)
downloadgit-53997a30f8138f41d1d9c7a45e84106cc21c0558.tar.gz
git-53997a30f8138f41d1d9c7a45e84106cc21c0558.tar.xz
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/clone.c')
-rw-r--r--builtin/clone.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 58bacbd55..05f8fb477 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -37,18 +37,17 @@ static const char * const builtin_clone_usage[] = {
NULL
};
-static int option_quiet, option_no_checkout, option_bare, option_mirror;
+static int option_no_checkout, option_bare, option_mirror;
static int option_local, option_no_hardlinks, option_shared, option_recursive;
static char *option_template, *option_reference, *option_depth;
static char *option_origin = NULL;
static char *option_branch = NULL;
static char *option_upload_pack = "git-upload-pack";
-static int option_verbose;
+static int option_verbosity;
static int option_progress;
static struct option builtin_clone_options[] = {
- OPT__QUIET(&option_quiet),
- OPT__VERBOSE(&option_verbose),
+ OPT__VERBOSITY(&option_verbosity),
OPT_BOOLEAN(0, "progress", &option_progress,
"force progress reporting"),
OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
@@ -462,7 +461,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
die("could not create leading directories of '%s'", git_dir);
set_git_dir(make_absolute_path(git_dir));
- init_db(option_template, option_quiet ? INIT_DB_QUIET : 0);
+ init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);
/*
* At this point, the config exists, so we do not need the
@@ -526,13 +525,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
transport_set_option(transport, TRANS_OPT_DEPTH,
option_depth);
- if (option_quiet)
- transport->verbose = -1;
- else if (option_verbose)
- transport->verbose = 1;
-
- if (option_progress)
- transport->progress = 1;
+ transport_set_verbosity(transport, option_verbosity, option_progress);
if (option_upload_pack)
transport_set_option(transport, TRANS_OPT_UPLOADPACK,
@@ -641,7 +634,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
opts.update = 1;
opts.merge = 1;
opts.fn = oneway_merge;
- opts.verbose_update = !option_quiet;
+ opts.verbose_update = (option_verbosity > 0);
opts.src_index = &the_index;
opts.dst_index = &the_index;