From: "Shawn O. Pearce" <spearce@spearce.org>
To: Nicolas Pitre <nico@cam.org>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH] Change 'Deltifying objects' to 'Delta compressing objects'
Date: Thu, 18 Oct 2007 23:17:37 -0400 [thread overview]
Message-ID: <20071019031737.GD14735@spearce.org> (raw)
In-Reply-To: <alpine.LFD.0.9999.0710182247130.19446@xanadu.home>
Nicolas Pitre <nico@cam.org> wrote:
> On Thu, 18 Oct 2007, Shawn O. Pearce wrote:
>
> > I really don't have an opinion either way. Actually I think the
> > entire progress system of git-pack-objects should be reduced even
> > further so that users aren't exposed to the internal phases we
> > are going through. Most of them just don't care. They just
> > want to know when its going to be done[*1*].
>
> Well, with my latest patches in that area, the typical progress on
> screen has been cut in half. And the different phases are intertaining.
Yup. Your patches were a big improvement. But I'm now sitting here
wondering if we shouldn't just allow a progress meter to overwrite
the prior one. Then you only see the current task and progress,
or the final output if we have nothing further to say about that.
Hmmph. Maybe something like this:
I like how it comes out in the end, but it really screws with the
sideband protocol. Like horribly. I got a whole ton of "remote:
remote: remote: remote: remote: remote:" during a remote clone.
diff --git a/progress.c b/progress.c
index 7629e05..099fc14 100644
--- a/progress.c
+++ b/progress.c
@@ -37,8 +37,6 @@ static void clear_progress_signal(void)
static int display(struct progress *progress, unsigned n, int done)
{
- char *eol;
-
if (progress->delay) {
if (!progress_update || --progress->delay)
return 0;
@@ -55,18 +53,26 @@ static int display(struct progress *progress, unsigned n, int done)
}
progress->last_value = n;
- eol = done ? ", done. \n" : " \r";
- if (progress->total) {
+ if (done) {
+ size_t c = strlen(progress->title);
+ while (c--)
+ fputc(' ', stderr);
+ fputs(" ", stderr);
+ for (; n > 0; n /= 10)
+ fputs(" ", stderr);
+ fputc('\r', stderr);
+ return 1;
+ } else if (progress->total) {
unsigned percent = n * 100 / progress->total;
if (percent != progress->last_percent || progress_update) {
progress->last_percent = percent;
fprintf(stderr, "%s: %3u%% (%u/%u)%s", progress->title,
- percent, n, progress->total, eol);
+ percent, n, progress->total, " \r");
progress_update = 0;
return 1;
}
} else if (progress_update) {
- fprintf(stderr, "%s: %u%s", progress->title, n, eol);
+ fprintf(stderr, "%s: %u%s", progress->title, n, " \r");
progress_update = 0;
return 1;
}
--
Shawn.
next prev parent reply other threads:[~2007-10-19 3:18 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-19 0:45 [PATCH] Change 'Deltifying objects' to 'Delta compressing objects' Shawn O. Pearce
2007-10-19 2:12 ` Jeff King
2007-10-19 2:19 ` Sam Vilain
2007-10-19 2:24 ` David Symonds
2007-10-19 2:34 ` Shawn O. Pearce
2007-10-19 3:02 ` Nicolas Pitre
2007-10-19 2:36 ` Jeff King
2007-10-19 2:55 ` Sam Vilain
2007-10-19 2:25 ` Jeff King
2007-10-19 2:21 ` Shawn O. Pearce
2007-10-19 2:34 ` Jeff King
2007-10-19 2:47 ` Shawn O. Pearce
2007-10-19 3:01 ` Nicolas Pitre
2007-10-19 3:07 ` Jeff King
2007-10-19 3:24 ` Nicolas Pitre
2007-10-19 3:32 ` Jeff King
2007-10-19 3:50 ` Nicolas Pitre
2007-10-19 3:56 ` Jeff King
2007-10-19 4:21 ` Linus Torvalds
2007-10-19 4:29 ` Jeff King
2007-10-19 11:58 ` Nicolas Pitre
2007-10-19 19:00 ` Linus Torvalds
2007-10-19 21:57 ` Linus Torvalds
2007-10-19 5:09 ` Shawn O. Pearce
2007-10-19 3:33 ` Shawn O. Pearce
2007-10-19 5:03 ` [PATCH] Stop displaying "Pack pack-$ID created." during git-gc Shawn O. Pearce
2007-10-19 2:49 ` [PATCH] Change 'Deltifying objects' to 'Delta compressing objects' Nicolas Pitre
2007-10-19 3:17 ` Shawn O. Pearce [this message]
2007-10-19 3:38 ` Nicolas Pitre
2007-10-19 3:41 ` Jeff King
2007-10-19 3:45 ` Shawn O. Pearce
2007-10-19 4:02 ` Nicolas Pitre
2007-10-19 11:44 ` Wincent Colaiuta
2007-10-19 2:45 ` Nicolas Pitre
2007-10-19 2:59 ` Jeff King
2007-10-19 3:11 ` Nicolas Pitre
2007-10-19 3:15 ` Jeff King
2007-10-19 3:27 ` Nicolas Pitre
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=20071019031737.GD14735@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=nico@cam.org \
--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).