Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 8d32e60

Browse files
peffgitster
authored andcommitted
send-pack: show progress when isatty(2)
The send_pack_args struct has two verbosity flags: "quiet" and "progress". Originally, if "quiet" was set, we would tell pack-objects explicitly to be quiet, and if "progress" was set, we would tell it to show progress. Otherwise, we told it neither, and it relied on isatty(2) to make the decision itself. However, commit 01fdc21 changed the meaning of these variables. Now both "quiet" and "!progress" instruct us to tell pack-objects to be quiet (and a non-zero "progress" means the same as before). This works well for transports which call send_pack directly, as the transport code copies transport->progress into send_pack_args->progress, and they both have the same meaning. However, the code path of calling "git send-pack" was left behind. It always sets "progress" to 0, and thus always tells pack-objects to be quiet. We can work around this by checking isatty(2) ourselves in the cmd_send_pack code path, restoring the original behavior of the send-pack command. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 01fdc21 commit 8d32e60

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/send-pack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
492492
}
493493
}
494494

495+
if (!args.quiet)
496+
args.progress = isatty(2);
497+
495498
if (args.stateless_rpc) {
496499
conn = NULL;
497500
fd[0] = 0;

0 commit comments

Comments
 (0)