mirror of
https://github.com/git/git.git
synced 2024-10-31 06:17:56 +01:00
9d81ecb52b
Add new start_sparse_progress() and start_delayed_sparse_progress() constructors and "sparse" flag to struct progress. Teach stop_progress() to force a 100% complete progress message before printing the final "done" message when "sparse" is set. Calling display_progress() for every item in a large set can be expensive. If callers try to filter this for performance reasons, such as emitting every k-th item, progress would not reach 100% unless they made a final call to display_progress() with the item count before calling stop_progress(). Now this is automatic when "sparse" is set. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 lines
625 B
C
16 lines
625 B
C
#ifndef PROGRESS_H
|
|
#define PROGRESS_H
|
|
|
|
struct progress;
|
|
|
|
void display_throughput(struct progress *progress, uint64_t total);
|
|
int display_progress(struct progress *progress, uint64_t n);
|
|
struct progress *start_progress(const char *title, uint64_t total);
|
|
struct progress *start_sparse_progress(const char *title, uint64_t total);
|
|
struct progress *start_delayed_progress(const char *title, uint64_t total);
|
|
struct progress *start_delayed_sparse_progress(const char *title,
|
|
uint64_t total);
|
|
void stop_progress(struct progress **progress);
|
|
void stop_progress_msg(struct progress **progress, const char *msg);
|
|
|
|
#endif
|