Skip to content

Commit

Permalink
gvfs-helper: simplify progress output during prefetch (#594)
Browse files Browse the repository at this point in the history
* [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.
  • Loading branch information
derrickstolee authored and dscho committed Aug 8, 2023
2 parents f891854 + 713585a commit a4ea2b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gvfs-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,13 +1855,8 @@ static void my_run_index_pack(struct gh__request_params *params,
strvec_push(&ip.args, "git");
strvec_push(&ip.args, "index-pack");

if (gh__cmd_opts.show_progress) {
strvec_push(&ip.args, "-v");
ip.err = 0;
} else {
ip.err = -1;
ip.no_stderr = 1;
}
ip.err = -1;
ip.no_stderr = 1;

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

if (gh__cmd_opts.show_progress)
params->progress = start_progress("Installing prefetch packfiles", np);

for (k = 0; k < np; k++) {
extract_packfile_from_multipack(params, status, fd, k);
display_progress(params->progress, k + 1);
if (status->ec != GH__ERROR_CODE__OK)
break;
nr_installed++;
}
stop_progress(&params->progress);

if (nr_installed)
delete_stale_keep_files(params, status);
Expand Down

0 comments on commit a4ea2b9

Please sign in to comment.