From patchwork Fri Sep 7 18:29:54 2018 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: 10592479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F055B17D2 for ; Fri, 7 Sep 2018 18:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E77A22B788 for ; Fri, 7 Sep 2018 18:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E59DE2B79C; Fri, 7 Sep 2018 18:30:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B9032B212 for ; Fri, 7 Sep 2018 18:30:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727685AbeIGXMX (ORCPT ); Fri, 7 Sep 2018 19:12:23 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45170 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726614AbeIGXMX (ORCPT ); Fri, 7 Sep 2018 19:12:23 -0400 Received: by mail-wr1-f68.google.com with SMTP id 20-v6so15829165wrb.12 for ; Fri, 07 Sep 2018 11:30:12 -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=d8wMRdmGN9/RM72VtsI6oeDpdDrVdXKEyh59sL3i1bk=; b=cRfM4k+bXceylLqTgcuVDxQl9ilqhoOGKjX1Hm/buMjR4DJdx+TMIbUTCW+osAT/6l CfoToDuIIr0CL691FtzGTh9FzMqMraSFLHW+SEgM51m0ExmjCBGWxFKJDFW7XL1ZsXRE H12Ws0ptCSHHF2y8mPpu/N5t+6Xg6IQN+N/NrOGMSqJOoJEr0a+bUSL8g8+L1uuGVtmW Z0C+uqT7npEGr2015fBySCt1g2/NobpK0EQDp9ituShJf/JVOKW1FyWwXf6tyUn/8Mrp nWWU01q9S3epoL7DYxSc003UIVchPb5i717QnxqMdjo6DZD0dNaD/csqIGoFgyktCgPu Q0Aw== 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=d8wMRdmGN9/RM72VtsI6oeDpdDrVdXKEyh59sL3i1bk=; b=E0HH7T+/mLTJB/zGE2set9gNMluNG4/1ea+VFegcYF6Qr+zhU6Iejp/I3hC723YduQ FLGyDq1UiFJOn0iEUmeq+LsE9nWx6W4vgDtvWL5OFrX8jVmhTikFvK6J4lrp/ZU9VoAa SjIo6XxrWmgI8kfKydnx1HjTPNbZG6GcbKMJ9fHCUG01l2rr+t+I/ueXCLcCRFIz5Mr9 n8ebFOyjYIwnc3EvhC7CMJ2kSD4ZDTexY7qE/mZXA8HchTPFQhmb+x5ESE50uMYUxsPi eqMLSufyzRFQu0tNdU58eio9HTvkwzum4aCqAzqjlz7ysWQ+xUdc535Pw1BVbaZzYVcI BGug== X-Gm-Message-State: APzg51AejcRbnKZ19AWUNxIuE0y3/gZ9etyPG8oS+EOTgoOt9TYX8l8S m9v1sVZdvqpCLhaDDD//+X9Hck6C X-Google-Smtp-Source: ANB0VdbThFbGiLEmFhmJ16nUCXj1+XimBK4PSlNdYmTViYZzzoMzRR3NwrQT4xPEThC52bQseVKeng== X-Received: by 2002:adf:cc8d:: with SMTP id p13-v6mr2190638wrj.67.1536345011149; Fri, 07 Sep 2018 11:30:11 -0700 (PDT) Received: from u.nix.is ([2a01:4f8:190:5095::2]) by smtp.gmail.com with ESMTPSA id m68-v6sm15396550wmb.10.2018.09.07.11.30.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 11:30:10 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee , Jeff King , Eric Sunshine , =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v2 2/2] commit-graph verify: add progress output Date: Fri, 7 Sep 2018 18:29:54 +0000 Message-Id: <20180907182954.2413-3-avarab@gmail.com> X-Mailer: git-send-email 2.19.0.rc1.350.ge57e33dbd1 In-Reply-To: <20180904202729.13900-1-avarab@gmail.com> References: <20180904202729.13900-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For the reasons explained in the "commit-graph write: add progress output" commit leading up to this one, emit progress on "commit-graph verify". Since e0fd51e1d7 ("fsck: verify commit-graph", 2018-06-27) "git fsck" has called this command if core.commitGraph=true, but there's been no progress output to indicate that anything was different. Now there is (on my tiny dotfiles.git repository): $ git -c core.commitGraph=true -C ~/ fsck Checking object directories: 100% (256/256), done. Checking objects: 100% (2821/2821), done. dangling blob 5b8bbdb9b788ed90459f505b0934619c17cc605b Verifying commits in commit graph: 100% (867/867), done. And on a larger repository, such as the 2015-04-03-1M-git.git test repository: $ time git -c core.commitGraph=true -C ~/g/2015-04-03-1M-git/ commit-graph verify Verifying commits in commit graph: 100% (1000447/1000447), done. real 0m7.813s [...] Since the "commit-graph verify" subcommand is never called from "git gc", we don't have to worry about passing some some "report_progress" progress variable around for this codepath. Signed-off-by: Ævar Arnfjörð Bjarmason --- commit-graph.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commit-graph.c b/commit-graph.c index 2c5d996194..0bfb8c180e 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -922,6 +922,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g) int generation_zero = 0; struct hashfile *f; int devnull; + struct progress *progress = NULL; if (!g) { graph_report("no commit-graph file loaded"); @@ -989,11 +990,14 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g) if (verify_commit_graph_error & ~VERIFY_COMMIT_GRAPH_ERROR_HASH) return verify_commit_graph_error; + progress = start_progress("Verifying commits in commit graph", + g->num_commits); for (i = 0; i < g->num_commits; i++) { struct commit *graph_commit, *odb_commit; struct commit_list *graph_parents, *odb_parents; uint32_t max_generation = 0; + display_progress(progress, i + 1); hashcpy(cur_oid.hash, g->chunk_oid_lookup + g->hash_len * i); graph_commit = lookup_commit(r, &cur_oid); @@ -1070,6 +1074,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g) graph_commit->date, odb_commit->date); } + stop_progress(&progress); return verify_commit_graph_error; }