git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik Faye-Lund <kusmabite@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, j.sixt@viscovery.net, peff@peff.net,
	rctay89@gmail.com
Subject: [PATCH] clone: fix progress-regression
Date: Mon,  7 May 2012 21:23:13 +0200	[thread overview]
Message-ID: <1336418593-2792-1-git-send-email-kusmabite@gmail.com> (raw)

In 5bd631b3 ("clone: support multiple levels of verbosity"), the
default behavior to show progress of the implicit checkout in
the clone-command regressed so that progress was only shown if
the verbose-option was specified.

Fix this by making option_verbosity == 0 output progress as well.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
---

Hmpf. While tidying this up for a proper submission, I found out that
writing a reliable test is tricky due to the start_progress_delay-usage.
I'd have to clone a repo that does not progress more than 50% of the
checkout-operation within one second or something like that (I didn't
quite follow the logic there), which is a lot :P. This strikes me as
error-prone, and I can't see an obvious hack around it (other than
modifying the progress-code, which I consider a somewhat nasty
alternative).

So perhaps writing a test to avoid similar breakages in the future isn't
worth it?

 builtin/clone.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index bbd5c96..a4d8d25 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -569,7 +569,7 @@ static int checkout(void)
 	opts.update = 1;
 	opts.merge = 1;
 	opts.fn = oneway_merge;
-	opts.verbose_update = (option_verbosity > 0);
+	opts.verbose_update = (option_verbosity >= 0);
 	opts.src_index = &the_index;
 	opts.dst_index = &the_index;
 
-- 
1.7.10.msysgit.1

             reply	other threads:[~2012-05-07 19:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07 19:23 Erik Faye-Lund [this message]
2012-05-07 19:47 ` [PATCH] clone: fix progress-regression Junio C Hamano
2012-05-08  5:46   ` Johannes Sixt

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=1336418593-2792-1-git-send-email-kusmabite@gmail.com \
    --to=kusmabite@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=peff@peff.net \
    --cc=rctay89@gmail.com \
    /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).