Skip to content

Commit 70d5e2d

Browse files
peffgitster
authored andcommittedJul 20, 2016
check_connected: add progress flag
Connectivity checks have to traverse the entire object graph in the worst case (e.g., a full clone or a full push). For large repositories like linux.git, this can take 30-60 seconds, during which time git may produce little or no output. Let's add the option of showing progress, which is taken care of by rev-list. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e033184 commit 70d5e2d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎connected.c

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ int check_connected(sha1_iterate_fn fn, void *cb_data,
5858
argv_array_push(&rev_list.args, "--not");
5959
argv_array_push(&rev_list.args, "--all");
6060
argv_array_push(&rev_list.args, "--quiet");
61+
if (opt->progress)
62+
argv_array_pushf(&rev_list.args, "--progress=%s",
63+
_("Checking connectivity"));
6164

6265
rev_list.git_cmd = 1;
6366
rev_list.in = -1;

‎connected.h

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ struct check_connected_options {
3030
* returns.
3131
*/
3232
int err_fd;
33+
34+
/* If non-zero, show progress as we traverse the objects. */
35+
int progress;
3336
};
3437

3538
#define CHECK_CONNECTED_INIT { 0 }

0 commit comments

Comments
 (0)
Please sign in to comment.