Skip to content

Commit 286183d

Browse files
derrickstoleegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 683c54c commit 286183d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

builtin/gc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ static int run_write_commit_graph(struct maintenance_run_opts *opts)
10291029

10301030
if (opts->quiet)
10311031
strvec_push(&child.args, "--no-progress");
1032+
else
1033+
strvec_push(&child.args, "--progress");
10321034

10331035
return !!run_command(&child);
10341036
}
@@ -1185,6 +1187,8 @@ static int pack_loose(struct maintenance_run_opts *opts)
11851187
strvec_push(&pack_proc.args, "pack-objects");
11861188
if (opts->quiet)
11871189
strvec_push(&pack_proc.args, "--quiet");
1190+
else
1191+
strvec_push(&pack_proc.args, "--no-quiet");
11881192
strvec_pushf(&pack_proc.args, "%s/pack/loose", r->objects->odb->path);
11891193

11901194
pack_proc.in = -1;
@@ -1263,6 +1267,8 @@ static int multi_pack_index_write(struct maintenance_run_opts *opts)
12631267

12641268
if (opts->quiet)
12651269
strvec_push(&child.args, "--no-progress");
1270+
else
1271+
strvec_push(&child.args, "--progress");
12661272

12671273
if (run_command(&child))
12681274
return error(_("failed to write multi-pack-index"));
@@ -1279,6 +1285,8 @@ static int multi_pack_index_expire(struct maintenance_run_opts *opts)
12791285

12801286
if (opts->quiet)
12811287
strvec_push(&child.args, "--no-progress");
1288+
else
1289+
strvec_push(&child.args, "--progress");
12821290

12831291
if (run_command(&child))
12841292
return error(_("'git multi-pack-index expire' failed"));
@@ -1335,6 +1343,8 @@ static int multi_pack_index_repack(struct maintenance_run_opts *opts)
13351343

13361344
if (opts->quiet)
13371345
strvec_push(&child.args, "--no-progress");
1346+
else
1347+
strvec_push(&child.args, "--progress");
13381348

13391349
strvec_pushf(&child.args, "--batch-size=%"PRIuMAX,
13401350
(uintmax_t)get_auto_pack_size());

0 commit comments

Comments
 (0)