git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 5c5d027d1a029c18062871715ee5e013d7f71eb0 1776 bytes (raw)
name: progress.h 	 # note: path name is non-authoritative(*)

 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
58
59
60
61
62
 
#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 {
	struct strbuf title;
	size_t title_len_utf8;

	struct strbuf status;
	size_t status_len_utf8;

	uint64_t last_update;
	uint64_t last_value;
	uint64_t total;
	unsigned last_percent;
	unsigned delay;
	struct throughput *throughput;
	uint64_t start_ns;
	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);
void stop_progress_early(struct progress **p_progress);

#endif

debug log:

solving 5c5d027d1a0 ...
found 5c5d027d1a0 in https://public-inbox.org/git/patch-22.25-e7f8314867d-20210623T155626Z-avarab@gmail.com/
found ba38447d104 in https://public-inbox.org/git/patch-16.25-2161d9cbef3-20210623T155626Z-avarab@gmail.com/
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 https://80x24.org/mirrors/git.git
preparing index
index prepared:
100644 f1913acf73f1790366ebd2f3f802f0472221bc7c	progress.h

applying [1/4] 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/4] 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


applying [3/4] https://public-inbox.org/git/patch-16.25-2161d9cbef3-20210623T155626Z-avarab@gmail.com/
diff --git a/progress.h b/progress.h
index 4693dddb6c5..ba38447d104 100644


applying [4/4] https://public-inbox.org/git/patch-22.25-e7f8314867d-20210623T155626Z-avarab@gmail.com/
diff --git a/progress.h b/progress.h
index ba38447d104..5c5d027d1a0 100644

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

index at:
100644 5c5d027d1a029c18062871715ee5e013d7f71eb0	progress.h

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).