Skip to content

Commit 228b538

Browse files
gvfs-helper: simplify progress output during prefetch (#594)
* [x] This change only applies to interactions with Azure DevOps and the GVFS Protocol. A user reported confusion when presented with the progress indicators for several `git index-pack` subprocesses during a prefetch. This happened by surprise, and is related to our issues with GVFS Cache Servers rejecting credentials and thus halting background maintenance until a foreground fetch happens. In the meantime, we can modify our progress output to be simpler in this case. There are two changes: 1. We unconditionally stifle output from `git index-pack`. It would be preferrable to pass a `-q` parameter, but it is not available. This prevents two progress indicators per prefetch packfile. 2. We add a conditional `Installing prefetch packfiles: ..% (X/Y)` indicator in the loop that installs these packfiles via `git index-pack`. This shows progress feedback frequently enough that users know something is happening without overwhelming their terminal interface.
2 parents 05f2392 + 3981c02 commit 228b538

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gvfs-helper.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,13 +1855,8 @@ static void my_run_index_pack(struct gh__request_params *params,
18551855
strvec_push(&ip.args, "git");
18561856
strvec_push(&ip.args, "index-pack");
18571857

1858-
if (gh__cmd_opts.show_progress) {
1859-
strvec_push(&ip.args, "-v");
1860-
ip.err = 0;
1861-
} else {
1862-
ip.err = -1;
1863-
ip.no_stderr = 1;
1864-
}
1858+
ip.err = -1;
1859+
ip.no_stderr = 1;
18651860

18661861
/* Skip generating the rev index, we don't need it. */
18671862
strvec_push(&ip.args, "--no-rev-index");
@@ -2350,12 +2345,17 @@ static void install_prefetch(struct gh__request_params *params,
23502345
trace2_data_intmax(TR2_CAT, NULL,
23512346
"prefetch/packfile_count", np);
23522347

2348+
if (gh__cmd_opts.show_progress)
2349+
params->progress = start_progress("Installing prefetch packfiles", np);
2350+
23532351
for (k = 0; k < np; k++) {
23542352
extract_packfile_from_multipack(params, status, fd, k);
2353+
display_progress(params->progress, k + 1);
23552354
if (status->ec != GH__ERROR_CODE__OK)
23562355
break;
23572356
nr_installed++;
23582357
}
2358+
stop_progress(&params->progress);
23592359

23602360
if (nr_installed)
23612361
delete_stale_keep_files(params, status);

0 commit comments

Comments
 (0)