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

[PATCH v2 04/10] fetch: refactor verbosity option handling into transport.[ch]

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Feb 24, 2010, 12:50 UTC
Message-ID
<1267015829-5344-5-git-send-email-rctay89@gmail.com>
In-Reply-To
<1267015829-5344-1-git-send-email-rctay89@gmail.com>
transport_set_verbosity() is now provided to transport users.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin-fetch.c |    5 +----
 transport.c     |    8 ++++++++
 transport.h     |    1 +
 3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/builtin-fetch.c b/builtin-fetch.c
index d3b9d8a..a7c7e67 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -823,10 +823,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 		die("Where do you want to fetch from today?");
 
 	transport = transport_get(remote, NULL);
-	if (verbosity >= 2)
-		transport->verbose = verbosity <= 3 ? verbosity : 3;
-	if (verbosity < 0)
-		transport->verbose = -1;
+	transport_set_verbosity(transport, verbosity);
 	if (upload_pack)
 		set_option(TRANS_OPT_UPLOADPACK, upload_pack);
 	if (keep)
diff --git a/transport.c b/transport.c
index 1a360cf..54f5ede 100644
--- a/transport.c
+++ b/transport.c
@@ -1012,6 +1012,14 @@ int transport_set_option(struct transport *transport,
 	return 1;
 }
 
+void transport_set_verbosity(struct transport *transport, int verbosity)
+{
+	if (verbosity >= 2)
+		transport->verbose = verbosity <= 3 ? verbosity : 3;
+	if (verbosity < 0)
+		transport->verbose = -1;
+}
+
 int transport_push(struct transport *transport,
 		   int refspec_nr, const char **refspec, int flags,
 		   int *nonfastforward)
diff --git a/transport.h b/transport.h
index 096f6e9..5a5ce3a 100644
--- a/transport.h
+++ b/transport.h
@@ -129,6 +129,7 @@ struct transport *transport_get(struct remote *, const char *);
  **/
 int transport_set_option(struct transport *transport, const char *name,
 			 const char *value);
+void transport_set_verbosity(struct transport *transport, int verbosity);
 
 int transport_push(struct transport *connection,
 		   int refspec_nr, const char **refspec, int flags,
-- 
1.7.0.20.gcb44ed
Previous: Tay Ray ChuanNext: Tay Ray Chuan
Message 5 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.