From 218558af599c01e5dec17a7399d9188a76c50203 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Sun, 4 Nov 2007 22:15:41 -0500 Subject: make display of total transferred more accurate The throughput display needs a delay period before accounting and displaying anything. Yet it might be called after some amount of data has already been transferred. The display of total data is therefore accounted late and therefore smaller than the reality. Let's call display_throughput() with an absolute amount of transferred data instead of a relative number, and let the throughput code find the relative amount of data by itself as needed. This way the displayed total is always exact. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- progress.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'progress.h') diff --git a/progress.h b/progress.h index 61cb68dfa5..3912969e60 100644 --- a/progress.h +++ b/progress.h @@ -3,7 +3,7 @@ struct progress; -void display_throughput(struct progress *progress, unsigned long n); +void display_throughput(struct progress *progress, off_t total); int display_progress(struct progress *progress, unsigned n); struct progress *start_progress(const char *title, unsigned total); struct progress *start_progress_delay(const char *title, unsigned total, -- cgit v1.2.3 From a984a06a07cdd0a843eb6107ad56e346d99ac840 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Thu, 8 Nov 2007 15:45:41 -0500 Subject: nicer display of thin pack completion In the same spirit of prettifying Git's output display for mere mortals, here's a simple extension to the progress API allowing for a final message to be provided when terminating a progress line, and use it for the display of the number of objects needed to complete a thin pack, saving yet one more line of screen display. Signed-off-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- progress.h | 1 + 1 file changed, 1 insertion(+) (limited to 'progress.h') diff --git a/progress.h b/progress.h index 3912969e60..611e4c4d42 100644 --- a/progress.h +++ b/progress.h @@ -9,5 +9,6 @@ struct progress *start_progress(const char *title, unsigned total); struct progress *start_progress_delay(const char *title, unsigned total, unsigned percent_treshold, unsigned delay); void stop_progress(struct progress **progress); +void stop_progress_msg(struct progress **progress, const char *msg); #endif -- cgit v1.2.3