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

[PATCH v2 06/10] clone: support multiple levels of verbosity

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Feb 24, 2010, 12:50 UTC
Message-ID
<1267015829-5344-7-git-send-email-rctay89@gmail.com>
In-Reply-To
<1267015829-5344-1-git-send-email-rctay89@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin-clone.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/builtin-clone.c b/builtin-clone.c
index 58bacbd..959fe4b 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -37,18 +37,17 @@ static const char * const builtin_clone_usage[] = {
 	NULL
 };
 
-static int option_quiet, option_no_checkout, option_bare, option_mirror;
+static int option_no_checkout, option_bare, option_mirror;
 static int option_local, option_no_hardlinks, option_shared, option_recursive;
 static char *option_template, *option_reference, *option_depth;
 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_verbosity;
 static int option_progress;
 
 static struct option builtin_clone_options[] = {
-	OPT__QUIET(&option_quiet),
-	OPT__VERBOSE(&option_verbose),
+	OPT__VERBOSITY(&option_verbosity),
 	OPT_BOOLEAN(0, "progress", &option_progress,
 			"force progress reporting"),
 	OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
@@ -462,7 +461,7 @@ 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_quiet ? INIT_DB_QUIET : 0);
+	init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);
 
 	/*
 	 * At this point, the config exists, so we do not need the
@@ -526,10 +525,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 			transport_set_option(transport, TRANS_OPT_DEPTH,
 					     option_depth);
 
-		if (option_quiet)
-			transport->verbose = -1;
-		else if (option_verbose)
-			transport->verbose = 1;
+		transport_set_verbosity(transport, option_verbosity);
 
 		if (option_progress)
 			transport->progress = 1;
@@ -641,7 +637,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		opts.update = 1;
 		opts.merge = 1;
 		opts.fn = oneway_merge;
-		opts.verbose_update = !option_quiet;
+		opts.verbose_update = (option_verbosity > 0);
 		opts.src_index = &the_index;
 		opts.dst_index = &the_index;
 
-- 
1.7.0.20.gcb44ed
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 7 of 11 in “teach --progress to transport-related builtins”
  1. 00/10 teach --progress to transport-related builtinsTay Ray Chuan, Feb 24, 2010
  2. 01/10 Documentation/git-clone: mention progress in -vTay Ray Chuan, Feb 24, 2010
  3. 02/10 Documentation/git-pull: put verbosity options before merge/fetch onesTay Ray Chuan, Feb 24, 2010
  4. 03/10 Documentation/git-push: put --quiet before --verboseTay Ray Chuan, Feb 24, 2010
  5. 04/10 fetch: refactor verbosity option handling into transport.[ch]Tay Ray Chuan, Feb 24, 2010
  6. 05/10 push: support multiple levels of verbosityTay Ray Chuan, Feb 24, 2010
  7. 06/10 clone: support multiple levels of verbosityTay Ray Chuan, Feb 24, 2010
  8. 07/10 transport->progress: use flag authoritativelyTay Ray Chuan, Feb 24, 2010
  9. 08/10 push: learn --progressTay Ray Chuan, Feb 24, 2010
  10. 09/10 fetch and pull: learn --progressTay Ray Chuan, Feb 24, 2010
  11. 10/10 transport: update flags to be in running orderTay Ray Chuan, Feb 24, 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.