maintenance: force progress/no-quiet to children

The --no-quiet option for 'git maintenance run' is supposed to indicate that progress should happen even while ignoring the value of isatty(2). However, Git implicitly asks child processes to check isatty(2) since these arguments are not passed through. The pass through of --no-quiet will be useful in a test in the next change. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Mar 24, 2025 at 00:51 UTC 286183da99e60258934790f6706b8db67b10dcab
1 file changed +10
builtin/gc.c
+10
@@ -1029,6 +1029,8 @@ static int run_write_commit_graph(struct maintenance_run_opts *opts)
1029
1030 if (opts->quiet)
1031 strvec_push(&child.args, "--no-progress");
1032 + else
1033 + strvec_push(&child.args, "--progress");
1034
1035 return !!run_command(&child);
1036 }
@@ -1185,6 +1187,8 @@ static int pack_loose(struct maintenance_run_opts *opts)
1187 strvec_push(&pack_proc.args, "pack-objects");
1188 if (opts->quiet)
1189 strvec_push(&pack_proc.args, "--quiet");
1190 + else
1191 + strvec_push(&pack_proc.args, "--no-quiet");
1192 strvec_pushf(&pack_proc.args, "%s/pack/loose", r->objects->odb->path);
1193
1194 pack_proc.in = -1;
@@ -1263,6 +1267,8 @@ static int multi_pack_index_write(struct maintenance_run_opts *opts)
1267
1268 if (opts->quiet)
1269 strvec_push(&child.args, "--no-progress");
1270 + else
1271 + strvec_push(&child.args, "--progress");
1272
1273 if (run_command(&child))
1274 return error(_("failed to write multi-pack-index"));
@@ -1279,6 +1285,8 @@ static int multi_pack_index_expire(struct maintenance_run_opts *opts)
1285
1286 if (opts->quiet)
1287 strvec_push(&child.args, "--no-progress");
1288 + else
1289 + strvec_push(&child.args, "--progress");
1290
1291 if (run_command(&child))
1292 return error(_("'git multi-pack-index expire' failed"));
@@ -1335,6 +1343,8 @@ static int multi_pack_index_repack(struct maintenance_run_opts *opts)
1343
1344 if (opts->quiet)
1345 strvec_push(&child.args, "--no-progress");
1346 + else
1347 + strvec_push(&child.args, "--progress");
1348
1349 strvec_pushf(&child.args, "--batch-size=%"PRIuMAX,
1350 (uintmax_t)get_auto_pack_size());