From 4c999acef12d64ec9a1c0b7e1e26a807b5b66d67 Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Mon, 7 Aug 2023 15:11:08 -0400 Subject: [PATCH 1/2] gvfs-helper: stop showing index-pack progress If we are showing progress, then we should do so only for how many prefetch packs are being downloaded. Stop sending the '-v' option to 'git index-pack' which creates too much noise. Signed-off-by: Derrick Stolee --- gvfs-helper.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gvfs-helper.c b/gvfs-helper.c index 4ae01d59db76c9..efc55d7a5d84ab 100644 --- a/gvfs-helper.c +++ b/gvfs-helper.c @@ -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"); From 3981c024725c398b5d250f0c91d58d7c20f0179f Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Mon, 7 Aug 2023 15:50:22 -0400 Subject: [PATCH 2/2] gvfs-helper: show progress of multiple prefetch packs When using a cache server to download multiple prefetch packs, the GVFS Protocol sends all packs in one download. This download is split into multiple files during that single HTTPS request. This also presents a single progress indicator such as Prefetch 1691384600 (2023-08-07 05:03:20 +0000) (bytes received): 25355702, done. After downloading all of these packs to the `tempPacks` directory of the shared object cache, we run `git index-pack` on each packfile individually. The previous change removed the verbose output of `git index-pack`, but that left the time spend indexing the packs without any progress indicator. Add a new progress indicator that ticks through the different prefetch pack-files that are being installed as we go. This presents a new progress indicator that terminates with output like Installing prefetch packfiles: 100% (14/14), done. This helps users understand what is going on without the extra noise of two output lines per `git index-pack` command. Signed-off-by: Derrick Stolee --- gvfs-helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gvfs-helper.c b/gvfs-helper.c index efc55d7a5d84ab..35e7ec5634ee1d 100644 --- a/gvfs-helper.c +++ b/gvfs-helper.c @@ -2345,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(¶ms->progress); if (nr_installed) delete_stale_keep_files(params, status);