[PATCH] clone: quell the progress report from init and report on clone
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Apr 1, 2010, 22:03 UTC
- Message-ID
- <4462210481812dc3b720b34f59e3051a65e41336.1270159202.git.git@drmicha.warpmail.net>
- In-Reply-To
- <7v7houxu8n.fsf@alter.siamese.dyndns.org>
From: Junio C Hamano <gitster@pobox.com>
Currently, a local glit clone reports only initializing an empty git dir, which is potentially confusing.
Instead, report that cloning is in progress and when it is done (unless -q) is given, and suppres the init report (unless -v is given).
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> --- I checked the documentation, there is really no place where the output of git clone is documented - no documentation or test change is necesessary.
I made it so that -v will restore the init message. Other than that this is really your path, Junio.
builtin/clone.c | 4 ++++ t/t5601-clone.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c index 05f8fb4..6e0584c 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo, transport = transport_get(remote, src_repo); ret = transport_get_remote_refs(transport); transport_disconnect(transport); + if (0 <= option_verbosity) + printf("done.\n"); return ret; } @@ -462,6 +464,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix) set_git_dir(make_absolute_path(git_dir)); init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0); + if (0 <= option_verbosity) + printf("Cloning into %s...\n", get_git_dir()); /* * At this point, the config exists, so we do not need the diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 2147567..678cee5 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' ' test_expect_success 'output from clone' ' rm -fr dst && git clone -n "file://$(pwd)/src" dst >output && - test $(grep Initialized output | wc -l) = 1 + test $(grep Clon output | wc -l) = 1 ' test_expect_success 'clone does not keep pack' '
-- 1.7.0.3.448.g82eeb