From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.1 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, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4D71E1F451 for ; Mon, 15 Jan 2024 01:18:26 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=sasl header.b=GZEcJfGC; dkim-atps=neutral Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A368A1F2117A for ; Mon, 15 Jan 2024 01:18:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ECFA823A2; Mon, 15 Jan 2024 01:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="GZEcJfGC" Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52F1E1FAA for ; Mon, 15 Jan 2024 01:18:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 19FC81D8856; Sun, 14 Jan 2024 20:13:44 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=mBz4QktZ2dJOFNc3Io0rktDqcol7G7TxSdWnBG 2gzcM=; b=GZEcJfGCtPd9EDGK3k1fDLWfyI4UArMWQvof1UxuPI9lU+TXOCL2+O 3eXHgA6wvPRPqHGw/SvLDO6YkyzPeWx0IZnirxskuv3tfQBG/TnqtSoEJyqyTMgN XAFtW22FAeWemv9pZmiizYjH3TwkBlzV87KyzxEWXeUJDlQ8gE+zQ= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 120C81D8855; Sun, 14 Jan 2024 20:13:44 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.125.200.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 7E2021D8854; Sun, 14 Jan 2024 20:13:43 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: "Nikolay Edigaryev via GitGitGadget" Cc: git@vger.kernel.org, Derrick Stolee , Nikolay Edigaryev Subject: Re: [PATCH] clone: support cloning of filtered bundles In-Reply-To: (Nikolay Edigaryev via GitGitGadget's message of "Sun, 14 Jan 2024 11:16:49 +0000") References: Date: Sun, 14 Jan 2024 17:13:42 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 53365BD4-B343-11EE-A6B9-78DCEB2EC81B-77302942!pb-smtp1.pobox.com "Nikolay Edigaryev via GitGitGadget" writes: > diff --git a/builtin/clone.c b/builtin/clone.c > index c6357af9498..4b3fedf78ed 100644 > --- a/builtin/clone.c > +++ b/builtin/clone.c > @@ -1227,9 +1227,18 @@ int cmd_clone(int argc, const char **argv, const char *prefix) > > if (fd > 0) > close(fd); > + > + if (has_filter) { > + strbuf_addf(&key, "remote.%s.promisor", remote_name); > + git_config_set(key.buf, "true"); > + strbuf_reset(&key); > + > + strbuf_addf(&key, "remote.%s.partialclonefilter", remote_name); > + git_config_set(key.buf, expand_list_objects_filter_spec(&header.filter)); > + strbuf_reset(&key); > + } > + > -# NEEDSWORK: 'git clone --bare' should be able to clone from a filtered > -# bundle, but that requires a change to promisor/filter config options. Sorry, but this "should be able to" does not make sense to me in the first place. I can understand how an operation to create a narrow clone of an unfiltered bundle and then prepare the resulting repository for future "fattening" by naming the unfiltered bundle file a "promisor", and allow the user to lazily fetch objects that have initially been filtered out of the bundle lazily. But a bundle that were created with objects _omitted_ already? It obviously cannot "promise" to deliber any objects that ought to be reachable from the objects contained in it, so setting the bundle file as promisor in the configuration does not help the resulting repository. Those missing objects must be obtained from somewhere other than that original "filtered" bundle, and if that source of objects that can promise all the objects that are ought to be reachable were specified as the promisor, it would make sense. But the source of this clone operation, i.e. the bundle file that is pointed at by "remote.$remote_name.url", cannot be that promisor.