提交 5a518ad4 编写于 作者: T Tay Ray Chuan 提交者: Junio C Hamano

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 21188b1e (Implement git clone -v),
which implemented the option to force progress reporting.
Signed-off-by: NTay Ray Chuan <rctay89@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 65273bfb
......@@ -102,6 +102,9 @@ objects from the source repository into a pack in the cloned repository.
--verbose::
-v::
Run verbosely.
--progress::
Progress status is reported on the standard error stream
by default when it is attached to a terminal, unless -q
is specified. This flag forces progress status even if the
......
......@@ -44,10 +44,13 @@ 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_progress;
static struct option builtin_clone_options[] = {
OPT__QUIET(&option_quiet),
OPT__VERBOSE(&option_verbose),
OPT_BOOLEAN(0, "progress", &option_progress,
"force progress reporting"),
OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
"don't create a checkout"),
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)
if (option_quiet)
transport->verbose = -1;
else if (option_verbose) {
else if (option_verbose)
transport->verbose = 1;
if (option_progress)
transport->progress = 1;
}
if (option_upload_pack)
transport_set_option(transport, TRANS_OPT_UPLOADPACK,
......
......@@ -27,7 +27,8 @@ test_expect_success 'redirected clone' '
'
test_expect_success 'redirected clone -v' '
git clone -v "file://$(pwd)/parent" clone-redirected-v >out 2>err &&
git clone --progress "file://$(pwd)/parent" clone-redirected-progress \
>out 2>err &&
test -s err
'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册