Git fork

progress: stop using `the_repository`

Stop using `the_repository` in the "progress" subsystem by passing in a
repository when initializing `struct progress`. Furthermore, store a
pointer to the repository in that struct so that we can pass it to the
trace2 API when logging information.

Adjust callers accordingly by using `the_repository`. While there may be
some callers that have a repository available in their context, this
trivial conversion allows for easier verification and bubbles up the use
of `the_repository` by one level.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
1f7e6478 913a1e15

+136 -59
+3 -1
builtin/blame.c
··· 1193 1193 sb.found_guilty_entry = &found_guilty_entry; 1194 1194 sb.found_guilty_entry_data = &pi; 1195 1195 if (show_progress) 1196 - pi.progress = start_delayed_progress(_("Blaming lines"), num_lines); 1196 + pi.progress = start_delayed_progress(the_repository, 1197 + _("Blaming lines"), 1198 + num_lines); 1197 1199 1198 1200 assign_blame(&sb, opt); 1199 1201
+1
builtin/commit-graph.c
··· 305 305 oidset_init(&commits, 0); 306 306 if (opts.progress) 307 307 progress = start_delayed_progress( 308 + the_repository, 308 309 _("Collecting commits from input"), 0); 309 310 310 311 while (strbuf_getline(&buf, stdin) != EOF) {
+8 -4
builtin/fsck.c
··· 197 197 unsigned int nr = 0; 198 198 int result = 0; 199 199 if (show_progress) 200 - progress = start_delayed_progress(_("Checking connectivity"), 0); 200 + progress = start_delayed_progress(the_repository, 201 + _("Checking connectivity"), 0); 201 202 while (pending.nr) { 202 203 result |= traverse_one_object(object_array_pop(&pending)); 203 204 display_progress(progress, ++nr); ··· 703 704 fprintf_ln(stderr, _("Checking object directory")); 704 705 705 706 if (show_progress) 706 - progress = start_progress(_("Checking object directories"), 256); 707 + progress = start_progress(the_repository, 708 + _("Checking object directories"), 256); 707 709 708 710 for_each_loose_file_in_objdir(path, fsck_loose, fsck_cruft, fsck_subdir, 709 711 &cb_data); ··· 879 881 if (show_progress) { 880 882 for (struct packed_git *p = get_all_packs(r); p; p = p->next) 881 883 pack_count++; 882 - progress = start_delayed_progress("Verifying reverse pack-indexes", pack_count); 884 + progress = start_delayed_progress(the_repository, 885 + "Verifying reverse pack-indexes", pack_count); 883 886 pack_count = 0; 884 887 } 885 888 ··· 989 992 total += p->num_objects; 990 993 } 991 994 992 - progress = start_progress(_("Checking objects"), total); 995 + progress = start_progress(the_repository, 996 + _("Checking objects"), total); 993 997 } 994 998 for (p = get_all_packs(the_repository); p; 995 999 p = p->next) {
+5 -2
builtin/index-pack.c
··· 282 282 max = get_max_object_index(); 283 283 284 284 if (verbose) 285 - progress = start_delayed_progress(_("Checking objects"), max); 285 + progress = start_delayed_progress(the_repository, 286 + _("Checking objects"), max); 286 287 287 288 for (i = 0; i < max; i++) { 288 289 foreign_nr += check_object(get_indexed_object(i)); ··· 1249 1250 1250 1251 if (verbose) 1251 1252 progress = start_progress( 1253 + the_repository, 1252 1254 progress_title ? progress_title : 1253 1255 from_stdin ? _("Receiving objects") : _("Indexing objects"), 1254 1256 nr_objects); ··· 1329 1331 QSORT(ref_deltas, nr_ref_deltas, compare_ref_delta_entry); 1330 1332 1331 1333 if (verbose || show_resolving_progress) 1332 - progress = start_progress(_("Resolving deltas"), 1334 + progress = start_progress(the_repository, 1335 + _("Resolving deltas"), 1333 1336 nr_ref_deltas + nr_ofs_deltas); 1334 1337 1335 1338 nr_dispatched = 0;
+2 -1
builtin/log.c
··· 2495 2495 rev.add_signoff = cfg.do_signoff; 2496 2496 2497 2497 if (show_progress) 2498 - progress = start_delayed_progress(_("Generating patches"), total); 2498 + progress = start_delayed_progress(the_repository, 2499 + _("Generating patches"), total); 2499 2500 while (0 <= --nr) { 2500 2501 int shown; 2501 2502 display_progress(progress, total - nr);
+14 -7
builtin/pack-objects.c
··· 1264 1264 struct object_entry **write_order; 1265 1265 1266 1266 if (progress > pack_to_stdout) 1267 - progress_state = start_progress(_("Writing objects"), nr_result); 1267 + progress_state = start_progress(the_repository, 1268 + _("Writing objects"), nr_result); 1268 1269 ALLOC_ARRAY(written_list, to_pack.nr_objects); 1269 1270 write_order = compute_write_order(); 1270 1271 ··· 2400 2401 struct object_entry **sorted_by_offset; 2401 2402 2402 2403 if (progress) 2403 - progress_state = start_progress(_("Counting objects"), 2404 + progress_state = start_progress(the_repository, 2405 + _("Counting objects"), 2404 2406 to_pack.nr_objects); 2405 2407 2406 2408 CALLOC_ARRAY(sorted_by_offset, to_pack.nr_objects); ··· 3220 3222 unsigned nr_done = 0; 3221 3223 3222 3224 if (progress) 3223 - progress_state = start_progress(_("Compressing objects"), 3225 + progress_state = start_progress(the_repository, 3226 + _("Compressing objects"), 3224 3227 nr_deltas); 3225 3228 QSORT(delta_list, n, type_size_sort); 3226 3229 ll_find_deltas(delta_list, n, window+1, depth, &nr_done); ··· 3648 3651 static void enumerate_cruft_objects(void) 3649 3652 { 3650 3653 if (progress) 3651 - progress_state = start_progress(_("Enumerating cruft objects"), 0); 3654 + progress_state = start_progress(the_repository, 3655 + _("Enumerating cruft objects"), 0); 3652 3656 3653 3657 add_objects_in_unpacked_packs(); 3654 3658 add_unreachable_loose_objects(); ··· 3674 3678 revs.ignore_missing_links = 1; 3675 3679 3676 3680 if (progress) 3677 - progress_state = start_progress(_("Enumerating cruft objects"), 0); 3681 + progress_state = start_progress(the_repository, 3682 + _("Enumerating cruft objects"), 0); 3678 3683 ret = add_unseen_recent_objects_to_traversal(&revs, cruft_expiration, 3679 3684 set_cruft_mtime, 1); 3680 3685 stop_progress(&progress_state); ··· 3693 3698 if (prepare_revision_walk(&revs)) 3694 3699 die(_("revision walk setup failed")); 3695 3700 if (progress) 3696 - progress_state = start_progress(_("Traversing cruft objects"), 0); 3701 + progress_state = start_progress(the_repository, 3702 + _("Traversing cruft objects"), 0); 3697 3703 nr_seen = 0; 3698 3704 traverse_commit_list(&revs, show_cruft_commit, show_cruft_object, NULL); 3699 3705 ··· 4625 4631 prepare_packing_data(the_repository, &to_pack); 4626 4632 4627 4633 if (progress && !cruft) 4628 - progress_state = start_progress(_("Enumerating objects"), 0); 4634 + progress_state = start_progress(the_repository, 4635 + _("Enumerating objects"), 0); 4629 4636 if (stdin_packs) { 4630 4637 /* avoids adding objects in excluded packs */ 4631 4638 ignore_packed_keep_in_core = 1;
+2 -1
builtin/prune.c
··· 64 64 return; 65 65 66 66 if (show_progress) 67 - progress = start_delayed_progress(_("Checking connectivity"), 0); 67 + progress = start_delayed_progress(the_repository, 68 + _("Checking connectivity"), 0); 68 69 mark_reachable_objects(revs, 1, expire, progress); 69 70 stop_progress(&progress); 70 71 initialized = 1;
+2 -1
builtin/remote.c
··· 820 820 * Count symrefs twice, since "renaming" them is done by 821 821 * deleting and recreating them in two separate passes. 822 822 */ 823 - progress = start_progress(_("Renaming remote references"), 823 + progress = start_progress(the_repository, 824 + _("Renaming remote references"), 824 825 rename.remote_branches->nr + rename.symrefs_nr); 825 826 } 826 827 for (i = 0; i < remote_branches.nr; i++) {
+2 -1
builtin/rev-list.c
··· 735 735 revs.limited = 1; 736 736 737 737 if (show_progress) 738 - progress = start_delayed_progress(show_progress, 0); 738 + progress = start_delayed_progress(the_repository, 739 + show_progress, 0); 739 740 740 741 if (use_bitmap_index) { 741 742 if (!try_bitmap_count(&revs, filter_provided_objects))
+2 -1
builtin/unpack-objects.c
··· 590 590 use(sizeof(struct pack_header)); 591 591 592 592 if (!quiet) 593 - progress = start_progress(_("Unpacking objects"), nr_objects); 593 + progress = start_progress(the_repository, 594 + _("Unpacking objects"), nr_objects); 594 595 CALLOC_ARRAY(obj_list, nr_objects); 595 596 begin_odb_transaction(); 596 597 for (i = 0; i < nr_objects; i++) {
+17 -3
commit-graph.c
··· 1534 1534 1535 1535 if (ctx->report_progress) 1536 1536 ctx->progress = start_delayed_progress( 1537 + the_repository, 1537 1538 _("Loading known commits in commit graph"), 1538 1539 ctx->oids.nr); 1539 1540 for (i = 0; i < ctx->oids.nr; i++) { ··· 1551 1552 */ 1552 1553 if (ctx->report_progress) 1553 1554 ctx->progress = start_delayed_progress( 1555 + the_repository, 1554 1556 _("Expanding reachable commits in commit graph"), 1555 1557 0); 1556 1558 for (i = 0; i < ctx->oids.nr; i++) { ··· 1571 1573 1572 1574 if (ctx->report_progress) 1573 1575 ctx->progress = start_delayed_progress( 1576 + the_repository, 1574 1577 _("Clearing commit marks in commit graph"), 1575 1578 ctx->oids.nr); 1576 1579 for (i = 0; i < ctx->oids.nr; i++) { ··· 1688 1691 if (ctx->report_progress) 1689 1692 info.progress = ctx->progress 1690 1693 = start_delayed_progress( 1694 + the_repository, 1691 1695 _("Computing commit graph topological levels"), 1692 1696 ctx->commits.nr); 1693 1697 ··· 1722 1726 if (ctx->report_progress) 1723 1727 info.progress = ctx->progress 1724 1728 = start_delayed_progress( 1729 + the_repository, 1725 1730 _("Computing commit graph generation numbers"), 1726 1731 ctx->commits.nr); 1727 1732 ··· 1798 1803 1799 1804 if (ctx->report_progress) 1800 1805 progress = start_delayed_progress( 1806 + the_repository, 1801 1807 _("Computing commit changed paths Bloom filters"), 1802 1808 ctx->commits.nr); 1803 1809 ··· 1877 1883 data.commits = &commits; 1878 1884 if (flags & COMMIT_GRAPH_WRITE_PROGRESS) 1879 1885 data.progress = start_delayed_progress( 1886 + the_repository, 1880 1887 _("Collecting referenced commits"), 0); 1881 1888 1882 1889 refs_for_each_ref(get_main_ref_store(the_repository), add_ref_to_set, ··· 1908 1915 "Finding commits for commit graph in %"PRIuMAX" packs", 1909 1916 pack_indexes->nr), 1910 1917 (uintmax_t)pack_indexes->nr); 1911 - ctx->progress = start_delayed_progress(progress_title.buf, 0); 1918 + ctx->progress = start_delayed_progress(the_repository, 1919 + progress_title.buf, 0); 1912 1920 ctx->progress_done = 0; 1913 1921 } 1914 1922 for (i = 0; i < pack_indexes->nr; i++) { ··· 1959 1967 { 1960 1968 if (ctx->report_progress) 1961 1969 ctx->progress = start_delayed_progress( 1970 + the_repository, 1962 1971 _("Finding commits for commit graph among packed objects"), 1963 1972 ctx->approx_nr_objects); 1964 1973 for_each_packed_object(ctx->r, add_packed_commits, ctx, ··· 1977 1986 ctx->num_extra_edges = 0; 1978 1987 if (ctx->report_progress) 1979 1988 ctx->progress = start_delayed_progress( 1989 + the_repository, 1980 1990 _("Finding extra edges in commit graph"), 1981 1991 ctx->oids.nr); 1982 1992 oid_array_sort(&ctx->oids); ··· 2136 2146 get_num_chunks(cf)), 2137 2147 get_num_chunks(cf)); 2138 2148 ctx->progress = start_delayed_progress( 2149 + the_repository, 2139 2150 progress_title.buf, 2140 2151 st_mult(get_num_chunks(cf), ctx->commits.nr)); 2141 2152 } ··· 2348 2359 2349 2360 if (ctx->report_progress) 2350 2361 ctx->progress = start_delayed_progress( 2362 + the_repository, 2351 2363 _("Scanning merged commits"), 2352 2364 ctx->commits.nr); 2353 2365 ··· 2392 2404 current_graph_number--; 2393 2405 2394 2406 if (ctx->report_progress) 2395 - ctx->progress = start_delayed_progress(_("Merging commit-graph"), 0); 2407 + ctx->progress = start_delayed_progress(the_repository, 2408 + _("Merging commit-graph"), 0); 2396 2409 2397 2410 merge_commit_graph(ctx, g); 2398 2411 stop_progress(&ctx->progress); ··· 2874 2887 if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW)) 2875 2888 total += g->num_commits_in_base; 2876 2889 2877 - progress = start_progress(_("Verifying commits in commit graph"), 2890 + progress = start_progress(the_repository, 2891 + _("Verifying commits in commit graph"), 2878 2892 total); 2879 2893 } 2880 2894
+2 -1
delta-islands.c
··· 267 267 QSORT(todo, nr, tree_depth_compare); 268 268 269 269 if (progress) 270 - progress_state = start_progress(_("Propagating island marks"), nr); 270 + progress_state = start_progress(the_repository, 271 + _("Propagating island marks"), nr); 271 272 272 273 for (i = 0; i < nr; i++) { 273 274 struct object_entry *ent = todo[i].entry;
+1
diffcore-rename.c
··· 1567 1567 trace2_region_enter("diff", "inexact renames", options->repo); 1568 1568 if (options->show_rename_progress) { 1569 1569 progress = start_delayed_progress( 1570 + the_repository, 1570 1571 _("Performing inexact rename detection"), 1571 1572 (uint64_t)num_destinations * (uint64_t)num_sources); 1572 1573 }
+3 -1
entry.c
··· 188 188 189 189 dco->state = CE_RETRY; 190 190 if (show_progress) 191 - progress = start_delayed_progress(_("Filtering content"), dco->paths.nr); 191 + progress = start_delayed_progress(the_repository, 192 + _("Filtering content"), 193 + dco->paths.nr); 192 194 while (dco->filters.nr > 0) { 193 195 for_each_string_list_item(filter, &dco->filters) { 194 196 struct string_list available_paths = STRING_LIST_INIT_DUP;
+8 -3
midx-write.c
··· 1131 1131 1132 1132 ctx.pack_paths_checked = 0; 1133 1133 if (flags & MIDX_PROGRESS) 1134 - ctx.progress = start_delayed_progress(_("Adding packfiles to multi-pack-index"), 0); 1134 + ctx.progress = start_delayed_progress(r, 1135 + _("Adding packfiles to multi-pack-index"), 0); 1135 1136 else 1136 1137 ctx.progress = NULL; 1137 1138 ··· 1539 1540 CALLOC_ARRAY(count, m->num_packs); 1540 1541 1541 1542 if (flags & MIDX_PROGRESS) 1542 - progress = start_delayed_progress(_("Counting referenced objects"), 1543 + progress = start_delayed_progress( 1544 + r, 1545 + _("Counting referenced objects"), 1543 1546 m->num_objects); 1544 1547 for (i = 0; i < m->num_objects; i++) { 1545 1548 int pack_int_id = nth_midxed_pack_int_id(m, i); ··· 1549 1552 stop_progress(&progress); 1550 1553 1551 1554 if (flags & MIDX_PROGRESS) 1552 - progress = start_delayed_progress(_("Finding and deleting unreferenced packfiles"), 1555 + progress = start_delayed_progress( 1556 + r, 1557 + _("Finding and deleting unreferenced packfiles"), 1553 1558 m->num_packs); 1554 1559 for (i = 0; i < m->num_packs; i++) { 1555 1560 char *pack_name;
+9 -4
midx.c
··· 907 907 midx_report(_("incorrect checksum")); 908 908 909 909 if (flags & MIDX_PROGRESS) 910 - progress = start_delayed_progress(_("Looking for referenced packfiles"), 910 + progress = start_delayed_progress(r, 911 + _("Looking for referenced packfiles"), 911 912 m->num_packs + m->num_packs_in_base); 912 913 for (i = 0; i < m->num_packs + m->num_packs_in_base; i++) { 913 914 if (prepare_midx_pack(r, m, i)) ··· 927 928 } 928 929 929 930 if (flags & MIDX_PROGRESS) 930 - progress = start_sparse_progress(_("Verifying OID order in multi-pack-index"), 931 + progress = start_sparse_progress(r, 932 + _("Verifying OID order in multi-pack-index"), 931 933 m->num_objects - 1); 932 934 933 935 for (curr = m; curr; curr = curr->base_midx) { ··· 959 961 } 960 962 961 963 if (flags & MIDX_PROGRESS) 962 - progress = start_sparse_progress(_("Sorting objects by packfile"), 964 + progress = start_sparse_progress(r, 965 + _("Sorting objects by packfile"), 963 966 m->num_objects); 964 967 display_progress(progress, 0); /* TODO: Measure QSORT() progress */ 965 968 QSORT(pairs, m->num_objects, compare_pair_pos_vs_id); 966 969 stop_progress(&progress); 967 970 968 971 if (flags & MIDX_PROGRESS) 969 - progress = start_sparse_progress(_("Verifying object offsets"), m->num_objects); 972 + progress = start_sparse_progress(r, 973 + _("Verifying object offsets"), 974 + m->num_objects); 970 975 for (i = 0; i < m->num_objects + m->num_objects_in_base; i++) { 971 976 struct object_id oid; 972 977 struct pack_entry e;
+4 -2
pack-bitmap-write.c
··· 590 590 int closed = 1; /* until proven otherwise */ 591 591 592 592 if (writer->show_progress) 593 - writer->progress = start_progress("Building bitmaps", 593 + writer->progress = start_progress(the_repository, 594 + "Building bitmaps", 594 595 writer->selected_nr); 595 596 trace2_region_enter("pack-bitmap-write", "building_bitmaps_total", 596 597 the_repository); ··· 710 711 } 711 712 712 713 if (writer->show_progress) 713 - writer->progress = start_progress("Selecting bitmap commits", 0); 714 + writer->progress = start_progress(the_repository, 715 + "Selecting bitmap commits", 0); 714 716 715 717 for (;;) { 716 718 struct commit *chosen = NULL;
+3 -1
pack-bitmap.c
··· 2578 2578 tdata.trees = ewah_to_bitmap(bitmap_git->trees); 2579 2579 tdata.blobs = ewah_to_bitmap(bitmap_git->blobs); 2580 2580 tdata.tags = ewah_to_bitmap(bitmap_git->tags); 2581 - tdata.prg = start_progress("Verifying bitmap entries", result_popcnt); 2581 + tdata.prg = start_progress(revs->repo, 2582 + "Verifying bitmap entries", 2583 + result_popcnt); 2582 2584 tdata.seen = 0; 2583 2585 2584 2586 traverse_commit_list(revs, &test_show_commit, &test_show_object, &tdata);
+3 -1
preload-index.c
··· 132 132 133 133 memset(&pd, 0, sizeof(pd)); 134 134 if (refresh_flags & REFRESH_PROGRESS && isatty(2)) { 135 - pd.progress = start_delayed_progress(_("Refreshing index"), index->cache_nr); 135 + pd.progress = start_delayed_progress(the_repository, 136 + _("Refreshing index"), 137 + index->cache_nr); 136 138 pthread_mutex_init(&pd.mutex, NULL); 137 139 } 138 140
+20 -14
progress.c
··· 9 9 */ 10 10 11 11 #define GIT_TEST_PROGRESS_ONLY 12 - #define USE_THE_REPOSITORY_VARIABLE 13 12 #define DISABLE_SIGN_COMPARE_WARNINGS 14 13 15 14 #include "git-compat-util.h" ··· 37 36 }; 38 37 39 38 struct progress { 39 + struct repository *repo; 40 40 const char *title; 41 41 uint64_t last_value; 42 42 uint64_t total; ··· 254 254 display(progress, n, NULL); 255 255 } 256 256 257 - static struct progress *start_progress_delay(const char *title, uint64_t total, 257 + static struct progress *start_progress_delay(struct repository *r, 258 + const char *title, uint64_t total, 258 259 unsigned delay, unsigned sparse) 259 260 { 260 261 struct progress *progress = xmalloc(sizeof(*progress)); 262 + progress->repo = r; 261 263 progress->title = title; 262 264 progress->total = total; 263 265 progress->last_value = -1; ··· 270 272 progress->title_len = utf8_strwidth(title); 271 273 progress->split = 0; 272 274 set_progress_signal(); 273 - trace2_region_enter("progress", title, the_repository); 275 + trace2_region_enter("progress", title, r); 274 276 return progress; 275 277 } 276 278 ··· 284 286 return delay_in_secs; 285 287 } 286 288 287 - struct progress *start_delayed_progress(const char *title, uint64_t total) 289 + struct progress *start_delayed_progress(struct repository *r, 290 + const char *title, uint64_t total) 288 291 { 289 - return start_progress_delay(title, total, get_default_delay(), 0); 292 + return start_progress_delay(r, title, total, get_default_delay(), 0); 290 293 } 291 294 292 - struct progress *start_progress(const char *title, uint64_t total) 295 + struct progress *start_progress(struct repository *r, 296 + const char *title, uint64_t total) 293 297 { 294 - return start_progress_delay(title, total, 0, 0); 298 + return start_progress_delay(r, title, total, 0, 0); 295 299 } 296 300 297 301 /* ··· 303 307 * When "sparse" is set, stop_progress() will automatically force the done 304 308 * message to show 100%. 305 309 */ 306 - struct progress *start_sparse_progress(const char *title, uint64_t total) 310 + struct progress *start_sparse_progress(struct repository *r, 311 + const char *title, uint64_t total) 307 312 { 308 - return start_progress_delay(title, total, 0, 1); 313 + return start_progress_delay(r, title, total, 0, 1); 309 314 } 310 315 311 - struct progress *start_delayed_sparse_progress(const char *title, 316 + struct progress *start_delayed_sparse_progress(struct repository *r, 317 + const char *title, 312 318 uint64_t total) 313 319 { 314 - return start_progress_delay(title, total, get_default_delay(), 1); 320 + return start_progress_delay(r, title, total, get_default_delay(), 1); 315 321 } 316 322 317 323 static void finish_if_sparse(struct progress *progress) ··· 341 347 342 348 static void log_trace2(struct progress *progress) 343 349 { 344 - trace2_data_intmax("progress", the_repository, "total_objects", 350 + trace2_data_intmax("progress", progress->repo, "total_objects", 345 351 progress->total); 346 352 347 353 if (progress->throughput) 348 - trace2_data_intmax("progress", the_repository, "total_bytes", 354 + trace2_data_intmax("progress", progress->repo, "total_bytes", 349 355 progress->throughput->curr_total); 350 356 351 - trace2_region_leave("progress", progress->title, the_repository); 357 + trace2_region_leave("progress", progress->title, progress->repo); 352 358 } 353 359 354 360 void stop_progress_msg(struct progress **p_progress, const char *msg)
+9 -4
progress.h
··· 3 3 #include "gettext.h" 4 4 5 5 struct progress; 6 + struct repository; 6 7 7 8 #ifdef GIT_TEST_PROGRESS_ONLY 8 9 ··· 14 15 15 16 void display_throughput(struct progress *progress, uint64_t total); 16 17 void display_progress(struct progress *progress, uint64_t n); 17 - struct progress *start_progress(const char *title, uint64_t total); 18 - struct progress *start_sparse_progress(const char *title, uint64_t total); 19 - struct progress *start_delayed_progress(const char *title, uint64_t total); 20 - struct progress *start_delayed_sparse_progress(const char *title, 18 + struct progress *start_progress(struct repository *r, 19 + const char *title, uint64_t total); 20 + struct progress *start_sparse_progress(struct repository *r, 21 + const char *title, uint64_t total); 22 + struct progress *start_delayed_progress(struct repository *r, 23 + const char *title, uint64_t total); 24 + struct progress *start_delayed_sparse_progress(struct repository *r, 25 + const char *title, 21 26 uint64_t total); 22 27 void stop_progress_msg(struct progress **p_progress, const char *msg); 23 28 static inline void stop_progress(struct progress **p_progress)
+2 -1
prune-packed.c
··· 37 37 void prune_packed_objects(int opts) 38 38 { 39 39 if (opts & PRUNE_PACKED_VERBOSE) 40 - progress = start_delayed_progress(_("Removing duplicate objects"), 256); 40 + progress = start_delayed_progress(the_repository, 41 + _("Removing duplicate objects"), 256); 41 42 42 43 for_each_loose_file_in_objdir(repo_get_object_directory(the_repository), 43 44 prune_object, NULL, prune_subdir, &opts);
+2 -1
pseudo-merge.c
··· 459 459 return; 460 460 461 461 if (writer->show_progress) 462 - progress = start_progress("Selecting pseudo-merge commits", 462 + progress = start_progress(the_repository, 463 + "Selecting pseudo-merge commits", 463 464 writer->pseudo_merge_groups.nr); 464 465 465 466 refs_for_each_ref(get_main_ref_store(the_repository),
+2 -1
read-cache.c
··· 1523 1523 int t2_sum_scan = 0; 1524 1524 1525 1525 if (flags & REFRESH_PROGRESS && isatty(2)) 1526 - progress = start_delayed_progress(_("Refresh index"), 1526 + progress = start_delayed_progress(the_repository, 1527 + _("Refresh index"), 1527 1528 istate->cache_nr); 1528 1529 1529 1530 trace_performance_enter();
+5 -1
t/helper/test-progress.c
··· 17 17 * 18 18 * See 't0500-progress-display.sh' for examples. 19 19 */ 20 + 21 + #define USE_THE_REPOSITORY_VARIABLE 20 22 #define GIT_TEST_PROGRESS_ONLY 23 + 21 24 #include "test-tool.h" 22 25 #include "parse-options.h" 23 26 #include "progress.h" 27 + #include "repository.h" 24 28 #include "strbuf.h" 25 29 #include "string-list.h" 26 30 ··· 64 68 else 65 69 die("invalid input: '%s'", line.buf); 66 70 67 - progress = start_progress(title, total); 71 + progress = start_progress(the_repository, title, total); 68 72 } else if (skip_prefix(line.buf, "progress ", (const char **) &end)) { 69 73 uint64_t item_count = strtoull(end, &end, 10); 70 74 if (*end != '\0')
+3 -1
unpack-trees.c
··· 372 372 total++; 373 373 } 374 374 375 - return start_delayed_progress(_("Updating files"), total); 375 + return start_delayed_progress(the_repository, 376 + _("Updating files"), total); 376 377 } 377 378 378 379 static void setup_collided_checkout_detection(struct checkout *state, ··· 1773 1774 strbuf_reset(&prefix); 1774 1775 if (show_progress) 1775 1776 istate->progress = start_delayed_progress( 1777 + the_repository, 1776 1778 _("Updating index flags"), 1777 1779 istate->cache_nr); 1778 1780
+2 -1
walker.c
··· 172 172 uint64_t nr = 0; 173 173 174 174 if (walker->get_progress) 175 - progress = start_delayed_progress(_("Fetching objects"), 0); 175 + progress = start_delayed_progress(the_repository, 176 + _("Fetching objects"), 0); 176 177 177 178 while (process_queue) { 178 179 struct object *obj = process_queue->item;