From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id CCD811F45A for ; Mon, 24 Oct 2022 23:31:17 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=pobox.com header.i=@pobox.com header.b="tNjY1Zwr"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229932AbiJXXbL (ORCPT ); Mon, 24 Oct 2022 19:31:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231140AbiJXXaa (ORCPT ); Mon, 24 Oct 2022 19:30:30 -0400 Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 356E1D8F4F for ; Mon, 24 Oct 2022 14:51:51 -0700 (PDT) Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 454031406AB; Mon, 24 Oct 2022 16:50:47 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=nmgu+cVT2Q/ODTtvzFLrVXe3JHoVCVBRT/j3KC rGOBU=; b=tNjY1ZwryQQrB5jeOsG5dhyxkyHJl8D1JTz2Fc9UO6xawgJ4RuWvb3 eix8oD/xBuqCKwh89emLq45WGYYQgxj5eLR56x+ULjm1iwdOX4XXbz3BmsTzwTPj LmlLYOgTunoFh8Lz1tYA4PwkOQINIsZwLmvjZsY5WIHiuoWX77A+I= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 2EC2E1406AA; Mon, 24 Oct 2022 16:50:47 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.83.5.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 76D301406A8; Mon, 24 Oct 2022 16:50:46 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Taylor Blau Cc: git@vger.kernel.org, Derrick Stolee , Jeff King , Jonathan Tan , Victoria Dye , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Subject: Re: [PATCH 2/4] builtin/repack.c: pass "cruft_expiration" to `write_cruft_pack` References: <7d731d8dd5ebe0570a5dd8a88b3dd3104a79592a.1666636974.git.me@ttaylorr.com> Date: Mon, 24 Oct 2022 13:50:45 -0700 In-Reply-To: <7d731d8dd5ebe0570a5dd8a88b3dd3104a79592a.1666636974.git.me@ttaylorr.com> (Taylor Blau's message of "Mon, 24 Oct 2022 14:43:06 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 88B92F82-53DD-11ED-BFC7-307A8E0A682E-77302942!pb-smtp2.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Taylor Blau writes: > `builtin/repack.c`'s `write_cruft_pack()` is used to generate the cruft > pack when `--cruft` is supplied. It uses a static variable > "cruft_expiration" which is filled in by option parsing. > > A future patch will add an `--expire-to` option which allows `git > repack` to write a cruft pack containing the pruned objects out to a > separate repository. In order to implement this functionality, some > callers will have to pass a value for `cruft_expiration` different than > the one filled out by option parsing. > > Prepare for this by teaching `write_cruft_pack` to take a > "cruft_expiration" parameter, instead of reading a single static > variable. > > The (sole) existing caller of `write_cruft_pack()` will pass the value > for "cruft_expiration" filled in by option parsing, retaining existing > behavior. This means that we can make the variable local to > `cmd_repack()`, and eliminate the static declaration. Looks good to me.