From patchwork Thu Jul 22 12:20:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12393973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1354C63797 for ; Thu, 22 Jul 2021 12:20:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9CEF6135A for ; Thu, 22 Jul 2021 12:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231841AbhGVLjs (ORCPT ); Thu, 22 Jul 2021 07:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbhGVLjr (ORCPT ); Thu, 22 Jul 2021 07:39:47 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 033BCC061575 for ; Thu, 22 Jul 2021 05:20:22 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id c12so5722865wrt.3 for ; Thu, 22 Jul 2021 05:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IB52K4uElWxhyC7O3EYkhvZc2px8s1OTgNN5XYuIkDo=; b=hnlYvac7C6Vdli4JljSEdlUb+uf2UBLRNIA0e6f1XQ5pws8T7Rvm3uqnxECEnfCaON mjGhbbHchiFDIBrc29cz7TF46oLllQCK3ZiiztdC9uzwnf6ZBkHoTCxxK+MWncRR246P XhYmYtrfEbobqJ4yJHGu6wpyto2R6MMJ3XHiTrg0nrp/PDhVdUOJWNX6LNBuhsX0eMLm KvWZ2PXWlxgLumtCFypSO0awMzy09IJL6PDJQ4CcGy3ewa865QsWS4jPmsT3Kd8tLDZ2 vELBPwbJavTSbe/5KCjEGc5oy0/D4NjrXZJu0fNeglliKgppK7vFdoKJTVOs1rpfty4a vbWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IB52K4uElWxhyC7O3EYkhvZc2px8s1OTgNN5XYuIkDo=; b=bkzQJfBw37h07hew+ewVdEJgQ5X/uBODVyu6jzQBojG0elZU9f5ZXTrYpxuJ0hjui9 y7qrboby5hkc1NktX4WVON0xfAtfIvVHFkcwciDrUA1JVPuKAPSCDlOXLzb8H55SnxyR kQ+hC7C9/ZTJDI0uc2qOX1LpwmkhT9Bol8Wb8uFdqEgBEUBX9CRENIwqBQy5PM+jp+R1 iMQt4PdJHPjJ4T/ds/1LKBxrB+JEJAXzYhZbZQsI1t1mfXAz3qn+R62Y5Fwp/hV9uDzc sZsSJKf/5DcbgHvo2DEvw+6GKyVMpphQcGP3b88jL7ejVYKfBUUHcjuRRU5fO2aeS+KW p2xQ== X-Gm-Message-State: AOAM532haf2DmN4M/DxU26UyMniQkIhcuFFheC+LCsIkjDQ/EMnzvxgl ehluEo+E9q752mvkDYyHIYYhC++79PXKhQ== X-Google-Smtp-Source: ABdhPJwFHP/ollK9+gdEwhKoV8LCsPaSKJgHecxmB/DtDkCKlQGRx0gBPGtzb+2ocp183MaHg6++dQ== X-Received: by 2002:adf:ebc6:: with SMTP id v6mr47649442wrn.398.1626956420342; Thu, 22 Jul 2021 05:20:20 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n23sm23506991wms.4.2021.07.22.05.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 05:20:19 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Ren=C3=A9_S?= =?utf-8?q?charfe?= , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFy?= =?utf-8?b?bWFzb24=?= Subject: [PATCH 1/3] commit-graph: fix bogus counter in "Scanning merged commits" progress line Date: Thu, 22 Jul 2021 14:20:15 +0200 Message-Id: X-Mailer: git-send-email 2.32.0.957.gd9e39d72fe6 In-Reply-To: References: <20210620200303.2328957-1-szeder.dev@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: SZEDER Gábor The final value of the counter of the "Scanning merged commits" progress line is always one less than its expected total, e.g.: Scanning merged commits: 83% (5/6), done. This happens because while iterating over an array the loop variable is passed to display_progress() as-is, but while C arrays (and thus the loop variable) start at 0 and end at N-1, the progress counter must end at N. This causes the failures of the tests 'fetch.writeCommitGraph' and 'fetch.writeCommitGraph with submodules' in 't5510-fetch.sh' when run with GIT_TEST_CHECK_PROGRESS=1. Fix this by passing 'i + 1' to display_progress(), like most other callsites do. Signed-off-by: SZEDER Gábor Signed-off-by: Ævar Arnfjörð Bjarmason --- commit-graph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commit-graph.c b/commit-graph.c index 1a2602da61..918061f207 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -2096,7 +2096,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx) ctx->num_extra_edges = 0; for (i = 0; i < ctx->commits.nr; i++) { - display_progress(ctx->progress, i); + display_progress(ctx->progress, i + 1); if (i && oideq(&ctx->commits.list[i - 1]->object.oid, &ctx->commits.list[i]->object.oid)) { From patchwork Thu Jul 22 12:20:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12393975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 635A9C6377D for ; Thu, 22 Jul 2021 12:20:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 459F26135F for ; Thu, 22 Jul 2021 12:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231852AbhGVLjt (ORCPT ); Thu, 22 Jul 2021 07:39:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231824AbhGVLjs (ORCPT ); Thu, 22 Jul 2021 07:39:48 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E330DC061575 for ; Thu, 22 Jul 2021 05:20:22 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id r11so5707476wro.9 for ; Thu, 22 Jul 2021 05:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zDDmT+cwu1XitVL3ZnCajAm++HbGjdAsGYgNSbmDXB0=; b=gh5SE028LAHGKcTkZM+VBUWcOGz5LGnBFWcBtu5MWBCdf/FaulnFFfyyxEvyeh1Oxg eZiMVVXvcXt2ltXyhuhMzp7LaKlS4XecbA+WdBvbKKZWPFUv+PO57dq0IIXdKqpYmVfS pvHXN06UuXpDUsiBWfgHMy2W4RTGNuL2XZFV5urzv5xO7LzUvVLIYFwSy89hvY2QxBP7 U1ISW+g4MVwRGsncazCGOj/rfUB+nsi8cpLJvYzoVQ0wZsNwRQG9eNezI9tRJVq+T40L MwPnEZfZgbCCGX0hJaVY6mOneLHhW6oTvd2an0PrulcLiTI97kjWuZoepiZJlAbGZE2P HtdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zDDmT+cwu1XitVL3ZnCajAm++HbGjdAsGYgNSbmDXB0=; b=XUKFJgdB8QVBbLJQgv5A97bMFU0toMwi4XmdZ1jWx4KPNUoh4pCPh2uTDwm1N9KFsp 6g/hKCge/Moe0CXpnyi/0/oBPjrNQrFz/qS0tfFwB6vOX+TXU+gmWbIpouXGZkqntLYE ZhjHswSpdC3UnQNzuvYcMTjSdlrNMKIPssnZprE2jxZWtQS092pB5r5+BN0BkSGjZ52C 0rAu+/ygcs3iMoy6zwZkOZxmhVMnUFoMvA4ta9g2O2JVgtHL3PNoGPcjGNwwFb4OhD8P EGG/dl0DR9pL2hfmXVxg+F5Xg2BNE96V/9dxurEprzLNvS3t7TK36Yp/pFa/B06RAU8d 5m/w== X-Gm-Message-State: AOAM533G/7J+Dx9MiQMiEb0drudmwUolsFB8F+Uh7w8o9sWP8F9gNy5Q uL69KpDEjTgq9hGDn3FIAhSJCuEbTckI4Q== X-Google-Smtp-Source: ABdhPJzohHx2cqttm4Ubgdbv8t6HeFR0dy9S/P3rkvuuYmdxnHD7IEcdZH1mDOs0/qoexXfSus3fiA== X-Received: by 2002:adf:fc85:: with SMTP id g5mr48651357wrr.296.1626956421314; Thu, 22 Jul 2021 05:20:21 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n23sm23506991wms.4.2021.07.22.05.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 05:20:20 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Ren=C3=A9_S?= =?utf-8?q?charfe?= , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFy?= =?utf-8?b?bWFzb24=?= Subject: [PATCH 2/3] midx: don't provide a total for QSORT() progress Date: Thu, 22 Jul 2021 14:20:16 +0200 Message-Id: X-Mailer: git-send-email 2.32.0.957.gd9e39d72fe6 In-Reply-To: References: <20210620200303.2328957-1-szeder.dev@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The quicksort algorithm can be anywhere between O(n) and O(n^2), so providing a "num objects" as a total means that in some cases we're going to go past 100%. This fixes a logic error in 5ae18df9d8e (midx: during verify group objects by packfile to speed verification, 2019-03-21), which in turn seems to have been diligently copied from my own logic error in the commit-graph.c code, see 890226ccb57 (commit-graph write: add itermediate progress, 2019-01-19). That commit-graph code of mine was removed in 1cbdbf3bef7 (commit-graph: drop count_distinct_commits() function, 2020-12-07), so we don't need to fix that too. Signed-off-by: Ævar Arnfjörð Bjarmason --- midx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midx.c b/midx.c index 9a35b0255d..eaae75ab19 100644 --- a/midx.c +++ b/midx.c @@ -1291,7 +1291,7 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag if (flags & MIDX_PROGRESS) progress = start_sparse_progress(_("Sorting objects by packfile"), - m->num_objects); + 0); display_progress(progress, 0); /* TODO: Measure QSORT() progress */ QSORT(pairs, m->num_objects, compare_pair_pos_vs_id); stop_progress(&progress); From patchwork Thu Jul 22 12:20:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12393977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D5BBC6377D for ; Thu, 22 Jul 2021 12:20:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89C3461353 for ; Thu, 22 Jul 2021 12:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbhGVLjy (ORCPT ); Thu, 22 Jul 2021 07:39:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231849AbhGVLjt (ORCPT ); Thu, 22 Jul 2021 07:39:49 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA02FC061575 for ; Thu, 22 Jul 2021 05:20:23 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id 14-20020a05600c028eb0290228f19cb433so1461426wmk.0 for ; Thu, 22 Jul 2021 05:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NNc22YgJyX2pJYVaDSTtZ/nwPnKUlbYXxQxz6lHMFrM=; b=cH9ynwJj+dVfq74GiQKHMpFf+GyVUzwMHR6zv3cw0K1IXcAcP/lgPARmvhCD3mGXq0 ejAPpbjwZqVstlVfndlETHe2R0l1lcUopbWAugwLoFfF3zEdMYi+DRTtggsyzsiz5xS2 hbpMrbHbwBVt9nI8Xy0xB4KgYSGUzYyp0zfdykTpl6YgcBHw/qG5YngjwCvUYQJt8hJW hSpgI5KkF1qBqlYsPJu2BFjuElHWSgA3FiVWHDfdh2MdkNw6Z7XfVUrn4qkpo4vmRQ41 Mss8J/tRSywM/rbk3tjunwW3cykfsmTz1sxJ3SdZJ9mHQT57LVZMsIgjbU7tgkrNi339 nEvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NNc22YgJyX2pJYVaDSTtZ/nwPnKUlbYXxQxz6lHMFrM=; b=PIjVBU4kzwFX9VP0Ndg+//SBBFBPQv1PVjr4bpIzhjt8jWGfLtUZYE5IfF9brPHvSG 2V1/G/6mLxoroGnVfiGRyVBVybqw4i9QqQpgtLBZpkBg+vakX45QruP1I5LNXjWni/91 lBImGT2wcBLF4aQTCPwv9jg5DE7AZOe1VjyanDEXIB//+T5fUHg+i7EVpnjgZYm5uRLE PF4doWCvPmK4dr2SYPERQdvzLRie3vttBdyurSWQOE5OWVJSiTBhLQFZ6qp5I11MC+On hsNzsrj5nFRD5OSAGzQ8jnMtQp6OZPK6oeE0UtAs2p79loyo8bs1X9zxjojVVS9fBVyX DXew== X-Gm-Message-State: AOAM531HAp9EHAkWVq1FDL7PSe+F/94omiC06J5fIxvcPpHyFnEFWmjU cIB1FcaLNOncdc70IpKPM+xwlg+Sre97dg== X-Google-Smtp-Source: ABdhPJxGRGRAdKXKESzLu5SGLyDJRZEIGvkZq3eZnMPWoyi5Pe6JHYRNTjKfEZp5QWTPgmqKTXh2Vg== X-Received: by 2002:a1c:7314:: with SMTP id d20mr8741443wmb.156.1626956422180; Thu, 22 Jul 2021 05:20:22 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n23sm23506991wms.4.2021.07.22.05.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 05:20:21 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?q?SZEDER_G=C3=A1bor?= , =?utf-8?q?Ren=C3=A9_S?= =?utf-8?q?charfe?= , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFy?= =?utf-8?b?bWFzb24=?= Subject: [PATCH 3/3] entry: show finer-grained counter in "Filtering content" progress line Date: Thu, 22 Jul 2021 14:20:17 +0200 Message-Id: X-Mailer: git-send-email 2.32.0.957.gd9e39d72fe6 In-Reply-To: References: <20210620200303.2328957-1-szeder.dev@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: SZEDER Gábor The "Filtering content" progress in entry.c:finish_delayed_checkout() is unusual because of how it calculates the progress count and because it shows the progress of a nested loop. It works basically like this: start_delayed_progress(p, nr_of_paths_to_filter) for_each_filter { display_progress(p, nr_of_paths_to_filter - nr_of_paths_still_left_to_filter) for_each_path_handled_by_the_current_filter { checkout_entry() } } stop_progress(p) There are two issues with this approach: - The work done by the last filter (or the only filter if there is only one) is never counted, so if the last filter still has some paths to process, then the counter shown in the "done" progress line will not match the expected total. This would cause a BUG() in an upcoming change that adds an assertion checking if the "total" at the end matches the last progress bar update.. This is because both use only one filter. (The test 'delayed checkout in process filter' uses two filters but the first one does all the work, so that test already happens to succeed even with such an assertion.) - The progress counter is updated only once per filter, not once per processed path, so if a filter has a lot of paths to process, then the counter might stay unchanged for a long while and then make a big jump (though the user still gets a sense of progress, because we call display_throughput() after each processed path to show the amount of processed data). Move the display_progress() call to the inner loop, right next to that checkout_entry() call that does the hard work for each path, and use a dedicated counter variable that is incremented upon processing each path. After this change the 'invalid file in delayed checkout' in 't0021-conversion.sh' would succeed with the future BUG() assertion discussed above but the 'missing file in delayed checkout' test would still fail, because its purposefully buggy filter doesn't process any paths, so we won't execute that inner loop at all (this will be fixed in a subsequent commit). Signed-off-by: SZEDER Gábor Signed-off-by: Ævar Arnfjörð Bjarmason --- entry.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/entry.c b/entry.c index 125fabdbd5..d92dd020b3 100644 --- a/entry.c +++ b/entry.c @@ -162,7 +162,7 @@ static int remove_available_paths(struct string_list_item *item, void *cb_data) int finish_delayed_checkout(struct checkout *state, int *nr_checkouts) { int errs = 0; - unsigned delayed_object_count; + unsigned processed_paths = 0; off_t filtered_bytes = 0; struct string_list_item *filter, *path; struct progress *progress; @@ -172,12 +172,10 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts) return errs; dco->state = CE_RETRY; - delayed_object_count = dco->paths.nr; - progress = start_delayed_progress(_("Filtering content"), delayed_object_count); + progress = start_delayed_progress(_("Filtering content"), dco->paths.nr); while (dco->filters.nr > 0) { for_each_string_list_item(filter, &dco->filters) { struct string_list available_paths = STRING_LIST_INIT_NODUP; - display_progress(progress, delayed_object_count - dco->paths.nr); if (!async_query_available_blobs(filter->string, &available_paths)) { /* Filter reported an error */ @@ -224,6 +222,7 @@ int finish_delayed_checkout(struct checkout *state, int *nr_checkouts) ce = index_file_exists(state->istate, path->string, strlen(path->string), 0); if (ce) { + display_progress(progress, ++processed_paths); errs |= checkout_entry(ce, state, NULL, nr_checkouts); filtered_bytes += ce->ce_stat_data.sd_size; display_throughput(progress, filtered_bytes);