]> git.ipfire.org Git - thirdparty/git.git/commitdiff
check_connected: add progress flag
authorJeff King <peff@peff.net>
Fri, 15 Jul 2016 10:32:28 +0000 (06:32 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Jul 2016 19:11:09 +0000 (12:11 -0700)
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>
connected.c
connected.h

index 5f5c8bd826cd93ce4af4d7726f748d5ea3862c83..8e3e4b1dc1271f0530d10469dc5ef4eeb46526ea 100644 (file)
@@ -58,6 +58,9 @@ int check_connected(sha1_iterate_fn fn, void *cb_data,
        argv_array_push(&rev_list.args, "--not");
        argv_array_push(&rev_list.args, "--all");
        argv_array_push(&rev_list.args, "--quiet");
+       if (opt->progress)
+               argv_array_pushf(&rev_list.args, "--progress=%s",
+                                _("Checking connectivity"));
 
        rev_list.git_cmd = 1;
        rev_list.in = -1;
index 5d88e26c79250e67abbc5d666e1095a4f1cc6be5..afa48cc0524764a65053f5bb1392142de3251609 100644 (file)
@@ -30,6 +30,9 @@ struct check_connected_options {
         * returns.
         */
        int err_fd;
+
+       /* If non-zero, show progress as we traverse the objects. */
+       int progress;
 };
 
 #define CHECK_CONNECTED_INIT { 0 }