From: Junio C Hamano Date: Wed, 3 Aug 2016 22:10:27 +0000 (-0700) Subject: Merge branch 'jk/push-progress' X-Git-Tag: v2.10.0-rc0~60 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a58a8e3f7156dadd5d5e9643168545ff057c111a?ds=inline;hp=--cc Merge branch 'jk/push-progress' "git push" and "git clone" learned to give better progress meters to the end user who is waiting on the terminal. * jk/push-progress: receive-pack: send keepalives during quiet periods receive-pack: turn on connectivity progress receive-pack: relay connectivity errors to sideband receive-pack: turn on index-pack resolving progress index-pack: add flag for showing delta-resolution progress clone: use a real progress meter for connectivity check check_connected: add progress flag check_connected: relay errors to alternate descriptor check_everything_connected: use a struct with named options check_everything_connected: convert to argv_array rev-list: add optional progress reporting check_everything_connected: always pass --quiet to rev-list --- a58a8e3f7156dadd5d5e9643168545ff057c111a diff --cc builtin/receive-pack.c index 3c9360aa6d,e41f55f4f5..92e1213ecc --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@@ -195,11 -200,11 +202,16 @@@ static int receive_pack_config(const ch return 0; } + if (strcmp(var, "receive.advertisepushoptions") == 0) { + advertise_push_options = git_config_bool(var, value); + return 0; + } + + if (strcmp(var, "receive.keepalive") == 0) { + keepalive_in_sec = git_config_int(var, value); + return 0; + } + return git_default_config(var, value, cb); } @@@ -1340,9 -1377,9 +1401,10 @@@ cleanup static void execute_commands(struct command *commands, const char *unpacker_error, - struct shallow_info *si) + struct shallow_info *si, + const struct string_list *push_options) { + struct check_connected_options opt = CHECK_CONNECTED_INIT; struct command *cmd; unsigned char sha1[20]; struct iterate_data data; @@@ -1353,14 -1392,28 +1417,28 @@@ return; } + if (use_sideband) { + memset(&muxer, 0, sizeof(muxer)); + muxer.proc = copy_to_sideband; + muxer.in = -1; + if (!start_async(&muxer)) + err_fd = muxer.in; + /* ...else, continue without relaying sideband */ + } + data.cmds = commands; data.si = si; - if (check_everything_connected(iterate_receive_command_list, 0, &data)) + opt.err_fd = err_fd; + opt.progress = err_fd && !quiet; + if (check_connected(iterate_receive_command_list, &data, &opt)) set_connectivity_errors(commands, si); + if (use_sideband) + finish_async(&muxer); + reject_updates_to_hidden(commands); - if (run_receive_hook(commands, "pre-receive", 0)) { + if (run_receive_hook(commands, "pre-receive", 0, push_options)) { for (cmd = commands; cmd; cmd = cmd->next) { if (!cmd->error_string) cmd->error_string = "pre-receive hook declined"; @@@ -1811,8 -1847,8 +1894,9 @@@ int cmd_receive_pack(int argc, const ch unpack_status = unpack_with_sideband(&si); update_shallow_info(commands, &si, &ref); } + use_keepalive = KEEPALIVE_ALWAYS; - execute_commands(commands, unpack_status, &si); + execute_commands(commands, unpack_status, &si, + &push_options); if (pack_lockfile) unlink_or_warn(pack_lockfile); if (report_status)