Skip to content

Commit 150cd3b

Browse files
szedergitster
authored andcommitted
commit-graph: fix "Writing out commit graph" progress counter
76ffbca (commit-graph: write Bloom filters to commit graph file, 2020-04-06) added two delayed progress lines to writing the Bloom filter index and data chunk. This is wrong, because a single common progress is used while writing all chunks, which is not updated while writing these two new chunks, resulting in incomplete-looking "done" lines: Expanding reachable commits in commit graph: 888679, done. Computing commit changed paths Bloom filters: 100% (888678/888678), done. Writing out commit graph in 6 passes: 66% (3554712/5332068), done. Use the common 'struct progress' instance while writing the Bloom filter chunks as well. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6f9d5f2 commit 150cd3b

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

commit-graph.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,23 +1086,14 @@ static void write_graph_chunk_bloom_indexes(struct hashfile *f,
10861086
struct commit **list = ctx->commits.list;
10871087
struct commit **last = ctx->commits.list + ctx->commits.nr;
10881088
uint32_t cur_pos = 0;
1089-
struct progress *progress = NULL;
1090-
int i = 0;
1091-
1092-
if (ctx->report_progress)
1093-
progress = start_delayed_progress(
1094-
_("Writing changed paths Bloom filters index"),
1095-
ctx->commits.nr);
10961089

10971090
while (list < last) {
10981091
struct bloom_filter *filter = get_bloom_filter(ctx->r, *list, 0);
10991092
cur_pos += filter->len;
1100-
display_progress(progress, ++i);
1093+
display_progress(ctx->progress, ++ctx->progress_cnt);
11011094
hashwrite_be32(f, cur_pos);
11021095
list++;
11031096
}
1104-
1105-
stop_progress(&progress);
11061097
}
11071098

11081099
static void write_graph_chunk_bloom_data(struct hashfile *f,
@@ -1111,26 +1102,17 @@ static void write_graph_chunk_bloom_data(struct hashfile *f,
11111102
{
11121103
struct commit **list = ctx->commits.list;
11131104
struct commit **last = ctx->commits.list + ctx->commits.nr;
1114-
struct progress *progress = NULL;
1115-
int i = 0;
1116-
1117-
if (ctx->report_progress)
1118-
progress = start_delayed_progress(
1119-
_("Writing changed paths Bloom filters data"),
1120-
ctx->commits.nr);
11211105

11221106
hashwrite_be32(f, settings->hash_version);
11231107
hashwrite_be32(f, settings->num_hashes);
11241108
hashwrite_be32(f, settings->bits_per_entry);
11251109

11261110
while (list < last) {
11271111
struct bloom_filter *filter = get_bloom_filter(ctx->r, *list, 0);
1128-
display_progress(progress, ++i);
1112+
display_progress(ctx->progress, ++ctx->progress_cnt);
11291113
hashwrite(f, filter->data, filter->len * sizeof(unsigned char));
11301114
list++;
11311115
}
1132-
1133-
stop_progress(&progress);
11341116
}
11351117

11361118
static int oid_compare(const void *_a, const void *_b)

0 commit comments

Comments
 (0)