From patchwork Fri Nov 20 11:55:21 2020 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: 11920169 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 84D21C63777 for ; Fri, 20 Nov 2020 11:55:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13A2822277 for ; Fri, 20 Nov 2020 11:55:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tJTm9U91" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727812AbgKTLzg (ORCPT ); Fri, 20 Nov 2020 06:55:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgKTLze (ORCPT ); Fri, 20 Nov 2020 06:55:34 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A60E9C0613CF for ; Fri, 20 Nov 2020 03:55:32 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id a186so7316029wme.1 for ; Fri, 20 Nov 2020 03:55:32 -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=Z3BPAJjztBU05UMTZFtwSEJ+EaGulxnYpdsqC2dPBfY=; b=tJTm9U91ZNOVJr4xNam6fPsQ+oHSskVFdVR050oNRy18s+6ayAZUHGEqLnijMLzLX+ svlAMZybcT6B1NOWgVM5s8hDF2DKwEfxheV9SmYQx0hg5ymKXyJe3ZdwHdn9xsKUjn4Y BahFhj5gic83I30RsCxWhafo3MJc0R6oIi38b+VzRHE6UVTJrsyLIYJb8nQfO0B7Q9IL PhAbeIGwjSIF9iuK2Ld1wR9BrIeAwv4qkWTBQL/wMPVeAAjFGZCxWrJxnE8kdxc0F7p1 Jm2+mV+TL0LTD9jmhKS4G1jRYBh6Zvx8naVxIzSmIzxm/T65AI1LZrDdVJO7J7MmF0Z6 Ae6Q== 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=Z3BPAJjztBU05UMTZFtwSEJ+EaGulxnYpdsqC2dPBfY=; b=WWrFrsB7Ryt14e1+gbsuD2OdMCp0RzgwS1CxT94DYyul6zYmuvl/jD4NoBnHTqcitF sYug4gK4+KreLCppebHY8xR7cU3LNN+XwmTUHI0vc6EIQK+oaD4vdZONBt7Xg3IBjZYZ FpC+2Vk1C59iSo8+rOOlvFaJMor2VB1OovEM8nUH4bsAimgW+3uFLoqTKHwrcqi0ebf9 gDMzzPxPuDHtHndIlYX1XSnfWh1yCxCi63C4/coNkdSqiMmh6ZV5rVv2Lqg6vMpTj2Hw OCSNRFkS44gznJ2xu8duhSr+AlCHRPl+TzLsjysBq9NOuUyET42YOjGrbqCRcqm5nkRS rIdg== X-Gm-Message-State: AOAM532fn84KSZ1n8bCSoAr2IAw0RjB3qmC8MCLPeEALX/DuOyWlFk87 TSdQ1dIaV2CgdE/gpKob7K6Sw3Ppybk= X-Google-Smtp-Source: ABdhPJySs8VJKbCIWubHMFPxONk8RqDd1T0NEVdr89BXmSW8gibS4LAOB5mpPhxGO1yzu1WueUO3+w== X-Received: by 2002:a7b:cc12:: with SMTP id f18mr9778422wmh.110.1605873328047; Fri, 20 Nov 2020 03:55:28 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id t7sm4773275wrp.26.2020.11.20.03.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 03:55:27 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Luc Van Oostenryck , =?utf-8?b?Tmd1eeG7hW4g?= =?utf-8?b?VGjDoWkgTmfhu41jIER1eQ==?= , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 1/2] gc docs: change --keep-base-pack to --keep-largest-pack Date: Fri, 20 Nov 2020 12:55:21 +0100 Message-Id: <20201120115522.23617-1-avarab@gmail.com> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8 In-Reply-To: <20200806214929.22qgjg3o2noosjuo@ltop.local> References: <20200806214929.22qgjg3o2noosjuo@ltop.local> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The --keep-base-pack option never existed in git.git. It was the name for the --keep-largest-pack option in earlier revisions of that series before it landed as ae4e89e549 ("gc: add --keep-largest-pack option", 2018-04-15). The later patches in that series[1][2] weren't changed to also refer to --keep-largest-pack, so we've had this reference to a nonexisting option ever since the feature initially landed. 1. 55dfe13df9 ("gc: add gc.bigPackThreshold config", 2018-04-15) 2. 9806f5a7bf ("gc --auto: exclude base pack if not enough mem to "repack -ad"", 2018-04-15) Reported-by: Luc Van Oostenryck Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/config/gc.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/config/gc.txt b/Documentation/config/gc.txt index 00ea0a678e..c834e07991 100644 --- a/Documentation/config/gc.txt +++ b/Documentation/config/gc.txt @@ -44,9 +44,9 @@ gc.autoDetach:: gc.bigPackThreshold:: If non-zero, all packs larger than this limit are kept when - `git gc` is run. This is very similar to `--keep-base-pack` + `git gc` is run. This is very similar to `--keep-largest-pack` except that all packs that meet the threshold are kept, not - just the base pack. Defaults to zero. Common unit suffixes of + just the largest pack. Defaults to zero. Common unit suffixes of 'k', 'm', or 'g' are supported. + Note that if the number of kept packs is more than gc.autoPackLimit, @@ -57,7 +57,7 @@ gc.autoPackLimit and gc.bigPackThreshold should be respected again. If the amount of memory estimated for `git repack` to run smoothly is not available and `gc.bigPackThreshold` is not set, the largest pack will also be excluded (this is the equivalent of running `git gc` with -`--keep-base-pack`). +`--keep-largest-pack`). gc.writeCommitGraph:: If true, then gc will rewrite the commit-graph file when From patchwork Fri Nov 20 11:55:22 2020 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: 11920171 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 53D5EC5519F for ; Fri, 20 Nov 2020 11:55:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9EF022255 for ; Fri, 20 Nov 2020 11:55:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TjXNZbKi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727690AbgKTLzb (ORCPT ); Fri, 20 Nov 2020 06:55:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgKTLzb (ORCPT ); Fri, 20 Nov 2020 06:55:31 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13D75C0613CF for ; Fri, 20 Nov 2020 03:55:31 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id o15so9764810wru.6 for ; Fri, 20 Nov 2020 03:55:31 -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=bmKRxZcHmwVuPYJPOu7BgjDRvXCh7LLhAmBAM4IVt98=; b=TjXNZbKiezdCt3DVJ+XZqmoAaY+zx7zBez5NhUosE8FuB6peJeQ7ZRgp1yFoqADMYO VYXM2Fa22wbYRFevyPZ9vTBeVMddpgPqcaQpFABG2N/ObDKrXOJkW7kZ327AiCysrApu YkD5roKAm5XamIr1GK8QgwvqAdS7M39rLsh0PK3msFJCLx9V7DxRFAxia6ec1V9zfrnn UPhp9mGKTA3pC1/h7VdpyGYathZ0cpdU2sRUJuBe+1RqQgsw+MQ6lXp7G74BG7lXTXv7 TwQiZyhq02y6OCOmj9bhxe2l9q1Tin46fewgDd7JWS0zGNbxlGl4vaMuzvl8WsFf5vxq PHqA== 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=bmKRxZcHmwVuPYJPOu7BgjDRvXCh7LLhAmBAM4IVt98=; b=NX6BXXLjizD+f532MZQ7U5YMkvAvmDTExKr/OReDiEkuUBwHV/0zejaKf60WG1Wd1+ le84IU3K9TXB7i6yj9eZtoMSmU0b+9kFbsDn36Z4TLkHakKUWHpflPwjMBGqxMUtEZv2 IYGqbei8F7tz/4YbPQgw0zXjU/slC4e5GOM2DLhM7kfhC+Y2EmNP8eLY3z2zJnNBiv6A waocUvjjrEvKJmfXPSOisEChSasbdjiOG/kEcgl8QmVBrputoMWReAhIvB5W4K0P9XNN 8z/QpdlaFC9f95ZpFsr4CYf6wFlE3pzR0i4bXJZg17/A/ARZpsywycCw80Zb+pId0sSs 6kbg== X-Gm-Message-State: AOAM530DmTY9AGrBFhkdF5YErglEa6moAFWoERdfaONpWMi4VKSAl2E6 5cNN0GX//+TALhW5gmeVoAmUBYK5iAcHKQ== X-Google-Smtp-Source: ABdhPJzajJr64gwD4FSf64p605Bj/pf03iyLFuQcDloWUIpZU/MeITSD3j6xHskRWe3sa6b4+7CnfA== X-Received: by 2002:adf:a54d:: with SMTP id j13mr16505590wrb.132.1605873329560; Fri, 20 Nov 2020 03:55:29 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id t7sm4773275wrp.26.2020.11.20.03.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 03:55:28 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Luc Van Oostenryck , =?utf-8?b?Tmd1eeG7hW4g?= =?utf-8?b?VGjDoWkgTmfhu41jIER1eQ==?= , =?utf-8?b?w4Z2?= =?utf-8?b?YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 2/2] gc: rename keep_base_pack variable for --keep-largest-pack Date: Fri, 20 Nov 2020 12:55:22 +0100 Message-Id: <20201120115522.23617-2-avarab@gmail.com> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8 In-Reply-To: <20200806214929.22qgjg3o2noosjuo@ltop.local> References: <20200806214929.22qgjg3o2noosjuo@ltop.local> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org As noted in an earlier change the keep_base_pack variable name is a relic from an earlier on-list version of ae4e89e549 ("gc: add --keep-largest-pack option", 2018-04-15) before it was renamed to --keep-largest-pack. Let's change the variable name to avoid that confusion, it's easier to read the code if there's a 1=1 mapping between the variable name and option name. Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/gc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 5cd2a43f9f..07c15e4b64 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -533,7 +533,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) const char *name; pid_t pid; int daemonized = 0; - int keep_base_pack = -1; + int keep_largest_pack = -1; timestamp_t dummy; struct option builtin_gc_options[] = { @@ -547,7 +547,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) OPT_BOOL_F(0, "force", &force, N_("force running gc even if there may be another gc running"), PARSE_OPT_NOCOMPLETE), - OPT_BOOL(0, "keep-largest-pack", &keep_base_pack, + OPT_BOOL(0, "keep-largest-pack", &keep_largest_pack, N_("repack all other packs except the largest pack")), OPT_END() }; @@ -624,8 +624,8 @@ int cmd_gc(int argc, const char **argv, const char *prefix) } else { struct string_list keep_pack = STRING_LIST_INIT_NODUP; - if (keep_base_pack != -1) { - if (keep_base_pack) + if (keep_largest_pack != -1) { + if (keep_largest_pack) find_base_packs(&keep_pack, 0); } else if (big_pack_threshold) { find_base_packs(&keep_pack, big_pack_threshold);