git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
4693dddb6c5e30068c0fcd0ec0e50689cf45b600 blob 1665 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
#ifndef PROGRESS_H
#define PROGRESS_H
#include "strbuf.h"

#define PROGRESS_THROUGHPUT_IDX_MAX      8

struct throughput {
	off_t curr_total;
	off_t prev_total;
	uint64_t prev_ns;
	unsigned int avg_bytes;
	unsigned int avg_misecs;
	unsigned int last_bytes[PROGRESS_THROUGHPUT_IDX_MAX];
	unsigned int last_misecs[PROGRESS_THROUGHPUT_IDX_MAX];
	unsigned int idx;
	struct strbuf display;
};

struct progress {
	const char *title;
	uint64_t last_value;
	uint64_t total;
	unsigned last_percent;
	unsigned delay;
	struct throughput *throughput;
	uint64_t start_ns;
	struct strbuf counters_sb;
	int title_len;
	int split;

	/*
	 * The test_* members are are only intended for testing the
	 * progress output, i.e. exclusively for 'test-tool progress'.
	 */
	int test_mode;
	uint64_t test_getnanotime;
};

/*
 * *_testing() functions are only for use in
 * t/helper/test-progress.c. Do not use them elsewhere!
 */
void test_progress_force_update(void);
struct progress *start_progress_testing(const char *title, uint64_t total);
void test_progress_setnanotime(struct progress *progress, uint64_t time);

void display_throughput(struct progress *progress, uint64_t total);
void 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
debug log:

solving 4693dddb6c5 ...
found 4693dddb6c5 in https://public-inbox.org/git/patch-14.25-88d864c373a-20210623T155626Z-avarab@gmail.com/
found 4fb2b483d36 in https://public-inbox.org/git/patch-13.25-f2e84e3a3f2-20210623T155626Z-avarab@gmail.com/
found f1913acf73f in git.git.git
preparing index
index prepared:
100644 f1913acf73f1790366ebd2f3f802f0472221bc7c	progress.h

applying [1/2] https://public-inbox.org/git/patch-13.25-f2e84e3a3f2-20210623T155626Z-avarab@gmail.com/
diff --git a/progress.h b/progress.h
index f1913acf73f..4fb2b483d36 100644


applying [2/2] https://public-inbox.org/git/patch-14.25-88d864c373a-20210623T155626Z-avarab@gmail.com/
diff --git a/progress.h b/progress.h
index 4fb2b483d36..4693dddb6c5 100644

Checking patch progress.h...
Applied patch progress.h cleanly.
Checking patch progress.h...
Applied patch progress.h cleanly.

index at:
100644 4693dddb6c5e30068c0fcd0ec0e50689cf45b600	progress.h

Code repositories for project(s) associated with this 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).