Skip to content

Commit 5a518ad

Browse files
rctaygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 65273bf commit 5a518ad

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Documentation/git-clone.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ objects from the source repository into a pack in the cloned repository.
102102

103103
--verbose::
104104
-v::
105+
Run verbosely.
106+
107+
--progress::
105108
Progress status is reported on the standard error stream
106109
by default when it is attached to a terminal, unless -q
107110
is specified. This flag forces progress status even if the

builtin-clone.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ static char *option_origin = NULL;
4444
static char *option_branch = NULL;
4545
static char *option_upload_pack = "git-upload-pack";
4646
static int option_verbose;
47+
static int option_progress;
4748

4849
static struct option builtin_clone_options[] = {
4950
OPT__QUIET(&option_quiet),
5051
OPT__VERBOSE(&option_verbose),
52+
OPT_BOOLEAN(0, "progress", &option_progress,
53+
"force progress reporting"),
5154
OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
5255
"don't create a checkout"),
5356
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)
524527

525528
if (option_quiet)
526529
transport->verbose = -1;
527-
else if (option_verbose) {
530+
else if (option_verbose)
528531
transport->verbose = 1;
532+
533+
if (option_progress)
529534
transport->progress = 1;
530-
}
531535

532536
if (option_upload_pack)
533537
transport_set_option(transport, TRANS_OPT_UPLOADPACK,

t/t5702-clone-options.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ test_expect_success 'redirected clone' '
2727
'
2828
test_expect_success 'redirected clone -v' '
2929
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 &&
3132
test -s err
3233
3334
'

0 commit comments

Comments
 (0)