git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Nicolas Pitre <nico@cam.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/6] more compact progress display
Date: Tue, 16 Oct 2007 22:11:37 -0400	[thread overview]
Message-ID: <20071017021137.GO13801@spearce.org> (raw)
In-Reply-To: <1192586150-13743-2-git-send-email-nico@cam.org>

Nicolas Pitre <nico@cam.org> wrote:
> Each progress can be on a single line instead of two.

Nice.  Of course that screws with git-gui and now I have to
match two regexs and not one.  But whatever.
 
> +++ b/progress.c
> @@ -35,10 +35,11 @@ static void clear_progress_signal(void)
>  	progress_update = 0;
>  }
>  
> -int display_progress(struct progress *progress, unsigned n)
> +static int display(struct progress *progress, unsigned n, int done)
>  {
> +	char *eol;
> +
>  	if (progress->delay) {
> -		char buf[80];
>  		if (!progress_update || --progress->delay)
>  			return 0;
>  		if (progress->total) {
> @@ -51,60 +52,56 @@ int display_progress(struct progress *progress, unsigned n)
>  				return 0;
>  			}
>  		}
> -		if (snprintf(buf, sizeof(buf),
> -			     progress->delayed_title, progress->total))
> -			fprintf(stderr, "%s\n", buf);
>  	}
> +
> +	progress->last_value = n;

Hmm. n is unsigned and last_value is signed.  Uh?  I know you are
using the special value -1 to mean we've never output anything for
this progress meter but mixing signed and unsigned always gives me
the willies.

-- 
Shawn.

  parent reply	other threads:[~2007-10-17  2:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-17  1:55 [PATCH 0/6] miscelaneous stuff Nicolas Pitre
2007-10-17  1:55 ` [PATCH 1/6] more compact progress display Nicolas Pitre
2007-10-17  1:55   ` [PATCH 2/6] cope with multiple line breaks within sideband progress messages Nicolas Pitre
2007-10-17  1:55     ` [PATCH 3/6] pack-objects: no delta possible with only one object in the list Nicolas Pitre
2007-10-17  1:55       ` [PATCH 4/6] pack-objects.c: fix some global variable abuse and memory leaks Nicolas Pitre
2007-10-17  1:55         ` [PATCH 5/6] fix const issues with some functions Nicolas Pitre
2007-10-17  1:55           ` [PATCH 6/6] fix for more minor memory leaks Nicolas Pitre
2007-10-17  2:15       ` Deltifying? (was [PATCH 3/6] pack-objects: no delta possible...) Shawn O. Pearce
2007-10-17  2:28         ` Nicolas Pitre
2007-10-17  2:11   ` Shawn O. Pearce [this message]
2007-10-17  2:24     ` [PATCH 1/6] more compact progress display Nicolas Pitre
2007-10-17  8:20     ` Karl Hasselström
2007-10-17 20:56       ` Nicolas Pitre
2007-10-18  4:58         ` Shawn O. Pearce
2007-10-18  8:34         ` Karl Hasselström
2007-10-17  6:34   ` Johannes Sixt
2007-10-17  6:37     ` Shawn O. Pearce

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20071017021137.GO13801@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).