git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: git@vger.kernel.org
Cc: Miklos Vajna <vmiklos@frugalware.org>,
	Nicolas Pitre <nico@fluxnic.net>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH 4/4] clone: use --progress to force progress reporting
Date: Sat, 26 Dec 2009 01:12:06 +0800	[thread overview]
Message-ID: <1261761126-5784-5-git-send-email-rctay89@gmail.com> (raw)
In-Reply-To: <1261761126-5784-4-git-send-email-rctay89@gmail.com>

Follow the argument convention of git-pack-objects, such that a
separate option (--preogress) is used to force progress reporting
instead of -v/--verbose.

-v/--verbose now does not force progress reporting. Make git-clone.txt
say so.

This should cover all the bases in 21188b1 (Implement git clone -v),
which implemented the option to force progress reporting.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 Documentation/git-clone.txt |    3 +++
 builtin-clone.c             |    8 ++++++--
 t/t5702-clone-options.sh    |    3 ++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index e722e6c..f43c8b2 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -102,6 +102,9 @@ objects from the source repository into a pack in the cloned repository.
 
 --verbose::
 -v::
+	Run verbosely.
+
+--progress::
 	Progress status is reported on the standard error stream
 	by default when it is attached to a terminal, unless -q
 	is specified. This flag forces progress status even if the
diff --git a/builtin-clone.c b/builtin-clone.c
index 463fbe4..58bacbd 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -44,10 +44,13 @@ 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_progress;
 
 static struct option builtin_clone_options[] = {
 	OPT__QUIET(&option_quiet),
 	OPT__VERBOSE(&option_verbose),
+	OPT_BOOLEAN(0, "progress", &option_progress,
+			"force progress reporting"),
 	OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
 		    "don't create a checkout"),
 	OPT_BOOLEAN(0, "bare", &option_bare, "create a bare repository"),
@@ -525,10 +528,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		if (option_quiet)
 			transport->verbose = -1;
-		else if (option_verbose) {
+		else if (option_verbose)
 			transport->verbose = 1;
+
+		if (option_progress)
 			transport->progress = 1;
-		}
 
 		if (option_upload_pack)
 			transport_set_option(transport, TRANS_OPT_UPLOADPACK,
diff --git a/t/t5702-clone-options.sh b/t/t5702-clone-options.sh
index 27825f5..02cb024 100755
--- a/t/t5702-clone-options.sh
+++ b/t/t5702-clone-options.sh
@@ -27,7 +27,8 @@ test_expect_success 'redirected clone' '
 '
 test_expect_success 'redirected clone -v' '
 
-	git clone -v "file://$(pwd)/parent" clone-redirected-v >out 2>err &&
+	git clone --progress "file://$(pwd)/parent" clone-redirected-progress \
+		>out 2>err &&
 	test -s err
 
 '
-- 
1.6.6.278.g3f5f

  reply	other threads:[~2009-12-25 17:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09  4:54 [PATCH/RFC] Add progress options Brent Goodrick
2009-12-25 17:12 ` [PATCH 0/4] clone: use --progress to mean -v Tay Ray Chuan
2009-12-25 17:12   ` [PATCH 1/4] check stderr with isatty() instead of stdout when deciding to show progress Tay Ray Chuan
2009-12-25 17:12     ` [PATCH 2/4] git-clone.txt: reword description of progress behaviour Tay Ray Chuan
2009-12-25 17:12       ` [PATCH 3/4] clone: set transport->verbose when -v/--verbose is used Tay Ray Chuan
2009-12-25 17:12         ` Tay Ray Chuan [this message]
2009-12-27  1:20           ` [PATCH 4/4] clone: use --progress to force progress reporting Miklos Vajna
2009-12-27  3:22             ` Tay Ray Chuan
2009-12-26  8:53   ` [PATCH 0/4] clone: use --progress to mean -v Johannes Schindelin
2009-12-27  3:27     ` Tay Ray Chuan
2009-12-29  1:30       ` Junio C Hamano
2009-12-29  3:06         ` Tay Ray Chuan

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=1261761126-5784-5-git-send-email-rctay89@gmail.com \
    --to=rctay89@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    --cc=vmiklos@frugalware.org \
    /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).