git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] clone: quell the progress report from init and report on clone

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Apr 23, 2010, 12:37 UTC
Message-ID
<35f1aab26b685ab5f124cfe1bf99b2d3a9fbaaa5.1272025319.git.git@drmicha.warpmail.net>
In-Reply-To
<1270386135.1675.1368217929@webmail.messagingengine.com>
From: Junio C Hamano <gitster@pobox.com>

Currently, a local git 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 suppress the init report.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
Basically this is your patch now, Junio, which is why it disappeared from my
radar. But I don't think you applied it, so I'm resubmitting.
v2 shuts up init unconditionally (even with -v), as you preferred.
 builtin/clone.c  |    6 +++++-
 t/t5601-clone.sh |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 05f8fb4..0bedde4 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;
 }
 
@@ -461,7 +463,9 @@ 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_verbosity < 0) ? INIT_DB_QUIET : 0);
+	if (0 <= option_verbosity)
+		printf("Cloning into %s...\n", get_git_dir());
+	init_db(option_template, INIT_DB_QUIET);
 
 	/*
 	 * 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.1.rc1.248.gcefbb
Previous: Michael J Gruber
Message 18 of 18 in “color (red) for error messages on all git commands”
  1. Neal KreitzingerMar 24, 2010
  2. Sverre RabbelierMar 24, 2010
  3. Alex RiesenMar 24, 2010
  4. Michael J GruberMar 25, 2010
  5. clone: quell the progress report from initMichael J Gruber, Mar 25, 2010
  6. Alex RiesenMar 25, 2010
  7. Michael J GruberMar 25, 2010
  8. Tilo SchwarzMar 25, 2010
  9. Junio C HamanoMar 26, 2010
  10. Nicolas PitreMar 26, 2010
  11. Junio C HamanoMar 26, 2010
  12. Junio C HamanoMar 30, 2010
  13. Michael J GruberMar 30, 2010
  14. Alex RiesenMar 30, 2010
  15. clone: quell the progress report from init and report on cloneMichael J Gruber, Apr 1, 2010
  16. Junio C HamanoApr 2, 2010
  17. Michael J GruberApr 4, 2010
  18. clone: quell the progress report from init and report on cloneMichael J Gruber, Apr 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.