@matheusbsbs / matheus-bagliano / commits / 5a518ad467
Fork 0

clone: use --progress to force progress reporting

Follow the argument convention of git-pack-objects, such that a separate option (--preogress) is used to force progress reporting instead of -v/--verbose. -v/--verbose now does not force progress reporting. Make git-clone.txt say so. This should cover all the bases in 21188b1 (Implement git clone -v), which implemented the option to force progress reporting. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Tay Ray Chuan committed Dec 26, 2009 at 01:12 UTC 5a518ad4679c91f0d0afd38fcc3cbf04e8699c46
3 files changed +11 -3
Documentation/git-clone.txt
+3
@@ -102,6 +102,9 @@ objects from the source repository into a pack in the cloned repository.
102
103 --verbose::
104 -v::
105 + Run verbosely.
106 +
107 +--progress::
108 Progress status is reported on the standard error stream
109 by default when it is attached to a terminal, unless -q
110 is specified. This flag forces progress status even if the
builtin-clone.c
+6 -2
@@ -44,10 +44,13 @@ static char *option_origin = NULL;
44 static char *option_branch = NULL;
45 static char *option_upload_pack = "git-upload-pack";
46 static int option_verbose;
47 +static int option_progress;
48
49 static struct option builtin_clone_options[] = {
50 OPT__QUIET(&option_quiet),
51 OPT__VERBOSE(&option_verbose),
52 + OPT_BOOLEAN(0, "progress", &option_progress,
53 + "force progress reporting"),
54 OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
55 "don't create a checkout"),
56 OPT_BOOLEAN(0, "bare", &option_bare, "create a bare repository"),
@@ -524,10 +527,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
527
528 if (option_quiet)
529 transport->verbose = -1;
527 - else if (option_verbose) {
530 + else if (option_verbose)
531 transport->verbose = 1;
532 +
533 + if (option_progress)
534 transport->progress = 1;
530 - }
535
536 if (option_upload_pack)
537 transport_set_option(transport, TRANS_OPT_UPLOADPACK,
t/t5702-clone-options.sh
+2 -1
@@ -27,7 +27,8 @@ test_expect_success 'redirected clone' '
27 '
28 test_expect_success 'redirected clone -v' '
29
30 - git clone -v "file://$(pwd)/parent" clone-redirected-v >out 2>err &&
30 + git clone --progress "file://$(pwd)/parent" clone-redirected-progress \
31 + >out 2>err &&
32 test -s err
33
34 '