2007-04-29 10:38:52 +04:00
|
|
|
#ifndef PROGRESS_H
|
|
|
|
#define PROGRESS_H
|
2022-02-04 00:40:18 +03:00
|
|
|
#include "gettext.h"
|
2007-04-18 22:27:45 +04:00
|
|
|
|
2007-10-30 21:57:32 +03:00
|
|
|
struct progress;
|
2007-04-18 22:27:45 +04:00
|
|
|
|
2020-04-27 17:22:37 +03:00
|
|
|
#ifdef GIT_TEST_PROGRESS_ONLY
|
|
|
|
|
|
|
|
extern int progress_testing;
|
|
|
|
extern uint64_t progress_test_ns;
|
|
|
|
void progress_test_force_update(void);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2017-11-13 23:15:58 +03:00
|
|
|
void display_throughput(struct progress *progress, uint64_t total);
|
progress: make display_progress() return void
Ever since the progress infrastructure was introduced in 96a02f8f6d
(common progress display support, 2007-04-18), display_progress() has
returned an int, telling callers whether it updated the progress bar
or not. However, this is:
- useless, because over the last dozen years there has never been a
single caller that cared about that return value.
- not quite true, because it doesn't print a progress bar when
running in the background, yet it returns 1; see 85cb8906f0
(progress: no progress in background, 2015-04-13).
The related display_throughput() function returned void already upon
its introduction in cf84d51c43 (add throughput to progress display,
2007-10-30).
Let's make display_progress() return void, too. While doing so
several return statements in display() become unnecessary, remove
them.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-05 03:45:36 +03:00
|
|
|
void display_progress(struct progress *progress, uint64_t n);
|
2017-11-13 23:15:58 +03:00
|
|
|
struct progress *start_progress(const char *title, uint64_t total);
|
2019-03-21 22:36:11 +03:00
|
|
|
struct progress *start_sparse_progress(const char *title, uint64_t total);
|
2017-11-13 23:15:58 +03:00
|
|
|
struct progress *start_delayed_progress(const char *title, uint64_t total);
|
2019-03-21 22:36:11 +03:00
|
|
|
struct progress *start_delayed_sparse_progress(const char *title,
|
|
|
|
uint64_t total);
|
2022-02-04 00:40:15 +03:00
|
|
|
void stop_progress_msg(struct progress **p_progress, const char *msg);
|
2022-02-04 00:40:18 +03:00
|
|
|
static inline void stop_progress(struct progress **p_progress)
|
|
|
|
{
|
|
|
|
stop_progress_msg(p_progress, _("done"));
|
|
|
|
}
|
2007-04-18 22:27:45 +04:00
|
|
|
#endif
|