From patchwork Wed Jan 16 13:29:42 2019 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: 10765919 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 83D5D91E for ; Wed, 16 Jan 2019 13:30:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 735BA2CEE7 for ; Wed, 16 Jan 2019 13:30:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66DB52D024; Wed, 16 Jan 2019 13:30:16 +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 09A592CD5A for ; Wed, 16 Jan 2019 13:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393170AbfAPNaP (ORCPT ); Wed, 16 Jan 2019 08:30:15 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40172 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393158AbfAPNaN (ORCPT ); Wed, 16 Jan 2019 08:30:13 -0500 Received: by mail-wm1-f66.google.com with SMTP id f188so1978315wmf.5 for ; Wed, 16 Jan 2019 05:30:13 -0800 (PST) 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=sC2qNZzmj+8JLaFcC1APTX7BuXGegsoDQvpreSQl+KM=; b=HXQCqPFb9y1RzDUM9zEUfvalO09NBfGq1nRNnowMnsS0+V4hHHC7T+o6v+owcJbdjd 8WFo3JOGpsQuWk9Xhfa+wI/UaltbECKzzVl9dYPv6nUqjBMqbmBdeAPx/eMWOX8NQPTG xpz5qlm+4QoW6GECEancDw/mJSNHQIACrlv7wbcKYQj+RaQUU6xUEdRdJGtGOhVVpDah WNxHQqKmbye50DgY+0OcXj76qftXXbAZYnrd8ra0tC39WxplI/de8Z867CO8gAYYJ7rE rp5dCXPcRdxNLWLdz48dgilael3946V3L8ITSYT/9eUPdJgHFY8/8Tl2gCHic9U3JKOZ oQSw== 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=sC2qNZzmj+8JLaFcC1APTX7BuXGegsoDQvpreSQl+KM=; b=mEGnvxKdMeaj6ewAKxhSVEglPuAs8AkjHF8IF5N2bl/AivSEUK4Fy5JMQ/5GDtn1EQ cx0js4OX33LN7ReZrV0yRdqcyVnNCHgiokxPS18UIApKK/b7gykGlpOM/T/vR4svX6+n j6DZZzG4AJG+DUqPU683LlFFCtoUELmriJy2q+DxM8JVHMG6sX3JEvdHBPuuIi1PkZ9G SYIMZ6/CjLgyT3NpzIkwC6MYoAR3Dk8Ks7JIEQtMMmLgEF3Ic5n4EXv2j948FQ2hXefS k7slnhH4cqSyt4Qmeeql2lo3Q3xPOkGFL7YLGFCvfaXgxka+7R+27K08ymP4zj7iUXUh Rxxw== X-Gm-Message-State: AJcUukegBD+0U8t8PWYlWGJuHe+hnlp/K8oOugrm6hYMBuulvnmykoPk PMemwdzKTwBmx0haegK2oQ+0/zqKvwI= X-Google-Smtp-Source: ALg8bN731EEZKp81qFsZHu0djTF/7VZD+x2gnsJnbQ4V77XAbGBHg984O5UxCF0I/kDMvnk2vNSo8Q== X-Received: by 2002:a7b:cf0f:: with SMTP id l15mr8104532wmg.30.1547645411895; Wed, 16 Jan 2019 05:30:11 -0800 (PST) Received: from vm.nix.is ([2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id 10sm44283964wmy.40.2019.01.16.05.30.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 05:30:10 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , =?utf-8?b?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH v5 4/9] commit-graph write: more descriptive "writing out" output Date: Wed, 16 Jan 2019 14:29:42 +0100 Message-Id: <20190116132947.26025-5-avarab@gmail.com> X-Mailer: git-send-email 2.20.1.153.gd81d796ee0 In-Reply-To: <20181122153922.16912-2-avarab@gmail.com> References: <20181122153922.16912-2-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 Make the "Writing out" part of the progress output more descriptive. Depending on the shape of the graph we either make 3 or 4 passes over it. Let's present this information to the user in case they're wondering what this number, which is much larger than their number of commits, has to do with writing out the commit graph. Now e.g. on linux.git we emit: $ ~/g/git/git --exec-path=$HOME/g/git -C ~/g/linux commit-graph write Finding commits for commit graph: 6529159, done. Expanding reachable commits in commit graph: 815990, done. Computing commit graph generation numbers: 100% (815983/815983), done. Writing out commit graph in 4 passes: 100% (3263932/3263932), done. A note on i18n: Why are we using the Q_() function and passing a number & English text for a singular which'll never be used? Because the plural rules of translated languages may not match those of English, and to use the plural function we need to use this format. Signed-off-by: Ævar Arnfjörð Bjarmason --- commit-graph.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commit-graph.c b/commit-graph.c index 0c3af28399..7653c4e9d6 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -784,6 +784,7 @@ void write_commit_graph(const char *obj_dir, struct commit_list *parent; struct progress *progress = NULL; uint64_t progress_cnt = 0; + struct strbuf progress_title = STRBUF_INIT; if (!commit_graph_compatible(the_repository)) return; @@ -966,8 +967,13 @@ void write_commit_graph(const char *obj_dir, int graph_passes = 3; if (num_large_edges) graph_passes++; + strbuf_addf(&progress_title, + Q_("Writing out commit graph in %d pass", + "Writing out commit graph in %d passes", + graph_passes), + graph_passes); progress = start_delayed_progress( - _("Writing out commit graph"), + progress_title.buf, graph_passes * commits.nr); } write_graph_chunk_fanout(f, commits.list, commits.nr, progress, &progress_cnt); @@ -976,6 +982,7 @@ void write_commit_graph(const char *obj_dir, if (num_large_edges) write_graph_chunk_large_edges(f, commits.list, commits.nr, progress, &progress_cnt); stop_progress(&progress); + strbuf_release(&progress_title); close_commit_graph(the_repository); finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);