git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: "Jeff King" <peff@peff.net>,
	"Sebastian Thiel" <byronimo@gmail.com>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH 03/10] fetch: refactor verbosity option handling into transport.[ch]
Date: Thu, 18 Feb 2010 20:37:04 +0800	[thread overview]
Message-ID: <1266496631-3980-4-git-send-email-rctay89@gmail.com> (raw)
In-Reply-To: <1266496631-3980-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 8654fa7..d23ea2a 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 3846aac..1632c4d 100644
--- a/transport.c
+++ b/transport.c
@@ -1013,6 +1013,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 7cea5cc..7d1a0b6 100644
--- a/transport.h
+++ b/transport.h
@@ -122,6 +122,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.27.g5d71b

  parent reply	other threads:[~2010-02-18 12:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-18 12:37 [PATCH 00/10] teach --progress to transport-related builtins Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 01/10] Documentation/git-pull.txt: mention --quiet and --verbose for fetching Tay Ray Chuan
2010-02-18 21:11   ` Junio C Hamano
2010-02-19  6:31     ` Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 02/10] Documentation/git-push.txt: put --quiet before --verbose Tay Ray Chuan
2010-02-18 12:37 ` Tay Ray Chuan [this message]
2010-02-18 12:37 ` [PATCH 04/10] push: support multiple levels of verbosity Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 05/10] clone: " Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 06/10] transport->progress: use flag authoritatively Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 07/10] push: learn --progress Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 08/10] fetch: " Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 09/10] pull: " Tay Ray Chuan
2010-02-18 12:37 ` [PATCH 10/10] transport: update flags to be in running order Tay Ray Chuan
2010-02-19  1:26 ` [PATCH 00/10] teach --progress to transport-related builtins Junio C Hamano
2010-02-19  6:31   ` Tay Ray Chuan
2010-02-19  7:53     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266496631-3980-4-git-send-email-rctay89@gmail.com \
    --to=rctay89@gmail.com \
    --cc=byronimo@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).