From patchwork Tue Jan 22 14:42:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775597 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 B59E317F0 for ; Tue, 22 Jan 2019 14:42:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A58C62A19F for ; Tue, 22 Jan 2019 14:42:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9943D2AA62; Tue, 22 Jan 2019 14:42:35 +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 0FC9D2AB94 for ; Tue, 22 Jan 2019 14:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728959AbfAVOmd (ORCPT ); Tue, 22 Jan 2019 09:42:33 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38217 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728713AbfAVOmc (ORCPT ); Tue, 22 Jan 2019 09:42:32 -0500 Received: by mail-wr1-f67.google.com with SMTP id v13so27651125wrw.5 for ; Tue, 22 Jan 2019 06:42: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=MN03LHVm0+8KK7+jJq6RQo8x9DaQXPHU+lJ9nH9vCGo=; b=AZN8dmgUrgOBQLTYDXK8iPQXwCVnYxzy/23VEsSM8sghdeUZpw4aTxzfJPCfJPC1Hi NKTco4ydoHMy9O+tcBcSiIv39ADLblUF0Yqbbx4l4VeJK9UHyZoucCKwX1ifzTSBUcZ/ DASIYL4RHg8SlgocUjJ/AQVoGP5QvFs+Fr6TFYfIYO9GyAoDS42GJsdWtz2HDLocY/mr khGyV5QZJL0vagqfyIsCZk7fJWRAEavDC8AK9JlXTlmRn9adLvkahUcz3o0E68NfxNsb CKXYxZCpDlpcRJkZecGTV+DifzZq5F+0ZY0qRJgxOATcXIwDFr2mv7B/YAQDnd6adjlJ LPmg== 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=MN03LHVm0+8KK7+jJq6RQo8x9DaQXPHU+lJ9nH9vCGo=; b=M1HEDcSk9ZfMM8dyjiHrp7lIkiIJMGpQ656uxv3l1pMpJEt8uHH4vnXuDtMM14Yobv B9FyHNhkSXEGvw3hOsILRN4iYF3DourPACMqX1nOkWJTlM+7FmC11HVIMD54lDg8467w qwyfmsk1TdhgyYqmnjxG7pzcb9GiNgDkDyC8kmdxQtJXnb55GFI9SFJrEY+sTY5EEgtG rv9cg5gYQ+oDl1toClkcPB4bA8UYSx9GWY7RKDf5lK2mmTO3yy/kMznLoKB7qsj/qmaN 8cFVbq3DEk8BK2n8vu9DkBxvJ+JnN47WyLH1fAYnErJpyQ9OZ2QAoPHWZIM/H4L2fY27 t/Kw== X-Gm-Message-State: AJcUukc42J1IDLVOdDHrbk4d40I6GZFqB29yJfULM2I707DcBIVOjVcX aoIPXKxo7Uyy736YK8540fbFiBvo X-Google-Smtp-Source: ALg8bN5fFg8nyICMU91QcyvlZGNbAvvzy5PwLoLj246mKY0zDkQ4pJX451y0TKyvYjwdzsKujwyiOA== X-Received: by 2002:adf:c612:: with SMTP id n18mr32129661wrg.174.1548168150490; Tue, 22 Jan 2019 06:42:30 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:29 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 01/13] fetch: fix extensions.partialclone name in error message Date: Tue, 22 Jan 2019 15:42:00 +0100 Message-Id: <20190122144212.15119-2-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 There is "extensions.partialclone" and "core.partialCloneFilter", but not "core.partialclone". Only "extensions.partialclone" is meant to contain a remote name. While at it, let's wrap the relevant code lines to keep them at a reasonable length. Signed-off-by: Christian Couder --- builtin/fetch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index e0140327aa..c0ade48f5d 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1478,7 +1478,8 @@ static inline void fetch_one_setup_partial(struct remote *remote) */ if (strcmp(remote->name, repository_format_partial_clone)) { if (filter_options.choice) - die(_("--filter can only be used with the remote configured in core.partialClone")); + die(_("--filter can only be used with the remote " + "configured in extensions.partialclone")); return; } @@ -1646,7 +1647,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) result = fetch_one(remote, argc, argv, prune_tags_ok); } else { if (filter_options.choice) - die(_("--filter can only be used with the remote configured in core.partialClone")); + die(_("--filter can only be used with the remote " + "configured in extensions.partialclone")); /* TODO should this also die if we have a previous partial-clone? */ result = fetch_multiple(&list); } From patchwork Tue Jan 22 14:42:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775599 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 7B27C1399 for ; Tue, 22 Jan 2019 14:42:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B83A2A19F for ; Tue, 22 Jan 2019 14:42:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EA392AA5F; Tue, 22 Jan 2019 14:42:37 +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 117F02A19F for ; Tue, 22 Jan 2019 14:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728961AbfAVOmg (ORCPT ); Tue, 22 Jan 2019 09:42:36 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:52006 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728774AbfAVOme (ORCPT ); Tue, 22 Jan 2019 09:42:34 -0500 Received: by mail-wm1-f66.google.com with SMTP id b11so14407773wmj.1 for ; Tue, 22 Jan 2019 06:42: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=wutLavTrUFm+pGaCnESAeomqLN1u0UjGjc/8mngdTBI=; b=u2vD2kbHDQN0qrsaiF4Kx5onZfRF5h4GvVWsKfCy/m6jLC+EwqZb95dW5QmL55h/Xj h7uKjdrbN5qXkBR/nQw1zLpLNs7AzcV7nYT43WO9Hjmflx618OIDUToSFg1810YwWN7w e0GanE42GwkzpdLDRnoTYVBUaO5YAvIDK7vKq151Ir+cRWl7p0UJZ3pcKwDEAWsyayYK IbXDkHZJdntKYkAGadxu1WtmfY/zsS8zZXe9FVJ7ZESMOBYJNA+NgYNL1dQZ33NdKd/m dc+EmwwSTUSysFPJI6GtpKi319bI2o0J+dRiSlqaEygKuH9s/NfuUtMSY4lzv3XkOa7f IDqQ== 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=wutLavTrUFm+pGaCnESAeomqLN1u0UjGjc/8mngdTBI=; b=BpYCLG3Z7juuxihAbYuKKYPtEgMQxEgYZXxG+9DiZLu6+GszNIeam8NaNxywZX9r2V dt0bRbAzk937jqcZIiaoPBMKDmS9hZrw/WUu+zLiotxd9vzOQKEvFwQhXsjCgHME4hc3 wvoka6iQ0Cr3smVumZ52eQzsbHhyLAF8A+MAG4eOyM07PIbsqTSJX8i0njYbWcmeCj+/ RBAavKbzTpMdVdDxvbcWPZHwpuaCIQKGo2krxpKMdOi1LINIgetzrrp6eZbE/6jq+H8f 9xj0DSgnjhvu38a4q5dEh2Biz+6AQ99PNAEsiub2CdxcwFSZKiFVHPv3kIlRV772mEk8 OocA== X-Gm-Message-State: AJcUukfBggWf9BaqzabYrXvVmPDVB9Pm6DiOdBjEZrOoZoD6exXyxzea /nTxQe8PXI1yigPKoJFKQ2UPXX2K X-Google-Smtp-Source: ALg8bN6VzM4f8bGb8zIE6C2fmGP+PE2AgZec8INiU1Zpq0L+Nbo4o6B1X2hPbWYQvO8XuqQHB3Hj2A== X-Received: by 2002:a1c:2088:: with SMTP id g130mr3985917wmg.122.1548168151286; Tue, 22 Jan 2019 06:42:31 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:30 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 02/13] partial-clone: add missing 'is' in doc Date: Tue, 22 Jan 2019 15:42:01 +0100 Message-Id: <20190122144212.15119-3-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 Signed-off-by: Christian Couder --- Documentation/technical/partial-clone.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/technical/partial-clone.txt b/Documentation/technical/partial-clone.txt index 1ef66bd788..896c7b3878 100644 --- a/Documentation/technical/partial-clone.txt +++ b/Documentation/technical/partial-clone.txt @@ -114,7 +114,7 @@ their ".pack" and ".idx" files. that it has, either because the local repository has that object in one of its promisor packfiles, or because another promisor object refers to it. + -When Git encounters a missing object, Git can see if it a promisor object +When Git encounters a missing object, Git can see if it is a promisor object and handle it appropriately. If not, Git can report a corruption. + This means that there is no need for the client to explicitly maintain an From patchwork Tue Jan 22 14:42:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775603 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 4ECC51823 for ; Tue, 22 Jan 2019 14:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C81D2A19F for ; Tue, 22 Jan 2019 14:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30E742ABCE; Tue, 22 Jan 2019 14:42:39 +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 897C32A3C9 for ; Tue, 22 Jan 2019 14:42:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728965AbfAVOmg (ORCPT ); Tue, 22 Jan 2019 09:42:36 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36745 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728700AbfAVOme (ORCPT ); Tue, 22 Jan 2019 09:42:34 -0500 Received: by mail-wr1-f65.google.com with SMTP id u4so27650787wrp.3 for ; Tue, 22 Jan 2019 06:42:33 -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=SXCghJv6pCiiUyaIi4S+Oj+odpx/0WOKaHLktNNpkUI=; b=rKp1mCGTfn0g03nCZ+jujMlKfUyGoa/tTIG6t5CvLllh1oQX/pO92vlVOdOKTy3M8y 2an17guySqVi2KEBEIW+/SkuLT4ctB2wmpMgMNGMRmKuOStcm5k8hjnUvMRnDcV/BXH0 OMap10tWaxE/8pekAmMk2FyfOE2VExKugmf/YWBCufaoSG6UfF/kz6TEms6SiTiaB5zb WvZaIuHUsDdIqU61/hySCQIlaTElCvZw9IucIYP7rWsxn0JC8KphgY3BFcTOyUdDClnx 0ihl8BYLQMxLbOnexMQvnEgG09Akuuw/ZGX/VuD8PLOZCmzBioTsJys/RlM2F2mcgBJu +ysg== 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=SXCghJv6pCiiUyaIi4S+Oj+odpx/0WOKaHLktNNpkUI=; b=EZcxj3TCE9qHBKpvP70bkAsnXs+jnAmuX2BFdtSCS7DFtxlICjULd2wszq/+ocImVn nFEd4/1j0Bf1H3i7Q++epnQg1sTHKZrr6d9XI5dhRay2DMvJADJdS3heiLixhPaNQM/I yl3OtCkZYvcDKcOYoYBDyJ7ZdQW/2iF2CLPDhNJz+wCxlfO8Nigt8vh15yqmnFz9aEv9 DKy4Hs9PMlXoAkKYanx+eBIUS6QW5jenp6ybACPgrhTtG9fi6Zh6uC7TuIBVLp3a8gtS jfLeSCXXfYOEutQYsEPtRV5j67V9RnoIdtXvC8H6tl2RgogSxR48yznHXl21Jf8iWrHV VCyA== X-Gm-Message-State: AJcUukfW+ZXDE3V2nRJh+y3wzhXtTCY0/NHDK/5TQavss9SHveXEklK+ ETxqCS2lnXeZxE2K7Tai2YbmOonW X-Google-Smtp-Source: ALg8bN4UFSOKLWEhCEil64pBCoFZU+Ej2rb3R9JyXMufRUEE4lmis8v5tl4wTVjdEThXkqruej0+hw== X-Received: by 2002:a5d:44d1:: with SMTP id z17mr32223045wrr.271.1548168152061; Tue, 22 Jan 2019 06:42:32 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:31 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli , Christian Couder Subject: [PATCH v2 03/13] fetch-object: make functions return an error code Date: Tue, 22 Jan 2019 15:42:02 +0100 Message-Id: <20190122144212.15119-4-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 From: Christian Couder The callers of the fetch_object() and fetch_objects() might be interested in knowing if these functions succeeded or not. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- fetch-object.c | 13 ++++++++----- fetch-object.h | 4 ++-- sha1-file.c | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/fetch-object.c b/fetch-object.c index 4266548800..eac4d448ef 100644 --- a/fetch-object.c +++ b/fetch-object.c @@ -5,11 +5,12 @@ #include "transport.h" #include "fetch-object.h" -static void fetch_refs(const char *remote_name, struct ref *ref) +static int fetch_refs(const char *remote_name, struct ref *ref) { struct remote *remote; struct transport *transport; int original_fetch_if_missing = fetch_if_missing; + int res; fetch_if_missing = 0; remote = remote_get(remote_name); @@ -19,12 +20,14 @@ static void fetch_refs(const char *remote_name, struct ref *ref) transport_set_option(transport, TRANS_OPT_FROM_PROMISOR, "1"); transport_set_option(transport, TRANS_OPT_NO_DEPENDENTS, "1"); - transport_fetch_refs(transport, ref); + res = transport_fetch_refs(transport, ref); fetch_if_missing = original_fetch_if_missing; + + return res; } -void fetch_objects(const char *remote_name, const struct object_id *oids, - int oid_nr) +int fetch_objects(const char *remote_name, const struct object_id *oids, + int oid_nr) { struct ref *ref = NULL; int i; @@ -36,5 +39,5 @@ void fetch_objects(const char *remote_name, const struct object_id *oids, new_ref->next = ref; ref = new_ref; } - fetch_refs(remote_name, ref); + return fetch_refs(remote_name, ref); } diff --git a/fetch-object.h b/fetch-object.h index d6444caa5a..7bcc7cadb0 100644 --- a/fetch-object.h +++ b/fetch-object.h @@ -3,7 +3,7 @@ struct object_id; -void fetch_objects(const char *remote_name, const struct object_id *oids, - int oid_nr); +int fetch_objects(const char *remote_name, const struct object_id *oids, + int oid_nr); #endif diff --git a/sha1-file.c b/sha1-file.c index 386b96e1d7..972f26e931 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -1304,8 +1304,8 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid, if (fetch_if_missing && repository_format_partial_clone && !already_retried && r == the_repository) { /* - * TODO Investigate having fetch_object() return - * TODO error/success and stopping the music here. + * TODO Investigate checking fetch_object() return + * TODO value and stopping on error here. * TODO Pass a repository struct through fetch_object, * such that arbitrary repositories work. */ From patchwork Tue Jan 22 14:42:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775611 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 1EB1A13B5 for ; Tue, 22 Jan 2019 14:42:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E3D92A19F for ; Tue, 22 Jan 2019 14:42:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0184D2A3C9; Tue, 22 Jan 2019 14:42:44 +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 825342A19F for ; Tue, 22 Jan 2019 14:42:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728976AbfAVOmn (ORCPT ); Tue, 22 Jan 2019 09:42:43 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37287 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728713AbfAVOmg (ORCPT ); Tue, 22 Jan 2019 09:42:36 -0500 Received: by mail-wm1-f67.google.com with SMTP id g67so14432094wmd.2 for ; Tue, 22 Jan 2019 06:42:34 -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=pKiSDrHmvOLfdHOET6EWLlQtaJLwLiW26pKNK863HMM=; b=nsl785e/OgwKmxH54QKf0fBmRPs1awsByJYYrv44OurnPmuey6lOzI+cYYYomGtXgw TxC73wz+g9fTatm/cfEO50RZow1Woekpisr2DpvYVrDrDBx/3EjDERI/BurLzoP5Wmb3 WfvQuy18rgq8q57AcfquxgaMwQ9enz0turTCohu/LxTVmmnzOCTr+8ZMsGwiUvVut2Kq uWQjNuavn2oHLaOqTrvQEhT0V06Xl8HLhIbjZLyc4LX7A4k493n8t7bQChvyKI4YcMOJ uu28drI9qkmVULlt8809fDHHiQvyG/ChVqVl5HHk2nhVrEjXsAvx5xcSmREWaBBY20+6 EuCQ== 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=pKiSDrHmvOLfdHOET6EWLlQtaJLwLiW26pKNK863HMM=; b=LlxT39l/em5sXqjpvoIT2ne51/YbV0JYDab78+0DvOCZ4VwXUZMCudhYSpDZEfU5Ee ye6o7YvJ23PFr3c5Co+cRATPc0kHo9kMfaJW8klk4atkMQHigSf6g4cvJr4FeZj7/EP5 w8/uCfH06hjJsDO+GHKltRXrKvjjd35AHVpRNpVBpwabA83eqJ5RqwsWjyE7jUH01HgK QxIUgDFEW8cE3Bd5zEQ62xj02Nsw9n1sQHgWEnSFHKMVfDuzH5Y9UOXEdatRSjn2WW/K auwc3A/B+31oTquzY/98+OskuloqVHIlu5moNEHC1+7wtegBxx4V/MtFgYo2BrAbn45J 8S7g== X-Gm-Message-State: AJcUukdnqXAaKadJUbmiR1mNqtjKRrQTFv45yxzbJnKGGo2smJjryquJ zp+PdWrS6KCz7Tpect0cjrUFwKVT X-Google-Smtp-Source: ALg8bN7LeqRkHcwIFLvWpdgnksvl+7tGM6biLwdoPQYrZAh6xU6OwL6vbDXUxs3v0aZaStLH3g8crw== X-Received: by 2002:a1c:2787:: with SMTP id n129mr4182614wmn.128.1548168152810; Tue, 22 Jan 2019 06:42:32 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:32 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli , Christian Couder Subject: [PATCH v2 04/13] Add initial support for many promisor remotes Date: Tue, 22 Jan 2019 15:42:03 +0100 Message-Id: <20190122144212.15119-5-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 From: Christian Couder The promisor-remote.{c,h} files will contain functions to manage many promisor remotes. We expect that there will not be a lot of promisor remotes, so it is ok to use a simple linked list to manage them. Helped-by: Jeff King Signed-off-by: Christian Couder --- Makefile | 1 + promisor-remote.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++ promisor-remote.h | 17 ++++++++ 3 files changed, 118 insertions(+) create mode 100644 promisor-remote.c create mode 100644 promisor-remote.h diff --git a/Makefile b/Makefile index 1a44c811aa..565a5fbb4e 100644 --- a/Makefile +++ b/Makefile @@ -949,6 +949,7 @@ LIB_OBJS += preload-index.o LIB_OBJS += pretty.o LIB_OBJS += prio-queue.o LIB_OBJS += progress.o +LIB_OBJS += promisor-remote.o LIB_OBJS += prompt.o LIB_OBJS += protocol.o LIB_OBJS += quote.o diff --git a/promisor-remote.c b/promisor-remote.c new file mode 100644 index 0000000000..d2f574651e --- /dev/null +++ b/promisor-remote.c @@ -0,0 +1,100 @@ +#include "cache.h" +#include "promisor-remote.h" +#include "config.h" + +static struct promisor_remote *promisors; +static struct promisor_remote **promisors_tail = &promisors; + +struct promisor_remote *promisor_remote_new(const char *remote_name) +{ + struct promisor_remote *o; + + o = xcalloc(1, sizeof(*o)); + o->remote_name = xstrdup(remote_name); + + *promisors_tail = o; + promisors_tail = &o->next; + + return o; +} + +static struct promisor_remote *promisor_remote_look_up(const char *remote_name, + struct promisor_remote **previous) +{ + struct promisor_remote *o, *p; + + for (p = NULL, o = promisors; o; p = o, o = o->next) + if (o->remote_name && !strcmp(o->remote_name, remote_name)) { + if (previous) + *previous = p; + return o; + } + + return NULL; +} + +static void promisor_remote_move_to_tail(struct promisor_remote *o, + struct promisor_remote *previous) +{ + if (previous) + previous->next = o->next; + else + promisors = o->next ? o->next : o; + o->next = NULL; + *promisors_tail = o; + promisors_tail = &o->next; +} + +static int promisor_remote_config(const char *var, const char *value, void *data) +{ + struct promisor_remote *o; + const char *name; + int namelen; + const char *subkey; + + if (parse_config_key(var, "remote", &name, &namelen, &subkey) < 0) + return 0; + + if (!strcmp(subkey, "promisor")) { + char *remote_name; + + if (!git_config_bool(var, value)) + return 0; + + remote_name = xmemdupz(name, namelen); + + if (!promisor_remote_look_up(remote_name, NULL)) + promisor_remote_new(remote_name); + + free(remote_name); + return 0; + } + + return 0; +} + +static void promisor_remote_init(void) +{ + static int initialized; + + if (initialized) + return; + initialized = 1; + + git_config(promisor_remote_config, NULL); +} + +struct promisor_remote *promisor_remote_find(const char *remote_name) +{ + promisor_remote_init(); + + if (!remote_name) + return promisors; + + return promisor_remote_look_up(remote_name, NULL); +} + +int has_promisor_remote(void) +{ + return !!promisor_remote_find(NULL); +} diff --git a/promisor-remote.h b/promisor-remote.h new file mode 100644 index 0000000000..bfbf7c0f21 --- /dev/null +++ b/promisor-remote.h @@ -0,0 +1,17 @@ +#ifndef PROMISOR_REMOTE_H +#define PROMISOR_REMOTE_H + +/* + * Promisor remote linked list + * Its information come from remote.XXX config entries. + */ +struct promisor_remote { + const char *remote_name; + struct promisor_remote *next; +}; + +extern struct promisor_remote *promisor_remote_new(const char *remote_name); +extern struct promisor_remote *promisor_remote_find(const char *remote_name); +extern int has_promisor_remote(void); + +#endif /* PROMISOR_REMOTE_H */ From patchwork Tue Jan 22 14:42:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775609 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 1BBAB1399 for ; Tue, 22 Jan 2019 14:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B0832A19F for ; Tue, 22 Jan 2019 14:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D422A3C9; Tue, 22 Jan 2019 14:42:43 +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 996132A19F for ; Tue, 22 Jan 2019 14:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728974AbfAVOmm (ORCPT ); Tue, 22 Jan 2019 09:42:42 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40685 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728882AbfAVOmg (ORCPT ); Tue, 22 Jan 2019 09:42:36 -0500 Received: by mail-wm1-f66.google.com with SMTP id f188so14405940wmf.5 for ; Tue, 22 Jan 2019 06:42:34 -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=LaoUnRDe7LDDoqzG6LyC6uCq7vKWP26VReoY9YQP5sg=; b=YuUe5VhE3vacHzIyLDM81V2KmneY+zMi4amlPccQl3GV/zS+rOPmQohm4g3y+xm5lw FxkpHBHXkHBPB7EtbSbz5RV4JOt6bnXBJPCjo7QrxloN+e6bx7Cp69CU0ULdPXLMXyeZ DzwJAc5RiMKHVxT4gHI1hbQnkoOfMo2f79QHBc2w+voiaxzJWbhZvekR4vAJOD3pXziN h7olgvEzLzPdCbczRXiFalHPoNhcxsgBR3Qk/HImK/d2+4j83YlH9sB/XcaFO8NVfGNV 9mgRyeVliKhdwzeYk2IPCpjFqFl9OQe0Bb/iRhJ1Xdo+5IsJp+op8xvytuFZh8nMrp+l s+kQ== 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=LaoUnRDe7LDDoqzG6LyC6uCq7vKWP26VReoY9YQP5sg=; b=UFcxu4skXCZedfJ9zRWWlCkIQ8V+L+ehshGzvtbJOqi9EAmimawuP12j3DeI9q0EcX StjLcQD/kDOjDLjY7B6FLdsWctu0SMcMZTJr77WDg7PqgsWMJT2BJHBXn0CDO85uCti7 RmTTv9QXmnQJSV54bHnhCvXDSYTVYwlbf4j/NftDkazSSd6TYYkKw5RIfkN7jnbDsAlb +9BH1YXCfeuk5wZ6RIZmQQkDrymEu6j1NLOKyVkkhgeOZIYAi+iyV4vpIonTdNiaoN06 SyVfxQbHgwiUYoEw4yupHHepo6mCwuB6MXnY0q58fswQfMxtmfgGd1JpqUZTHkk1hc8O lZQA== X-Gm-Message-State: AJcUuke6J7UDmai7a4zkNbTUYhyVma1M0eBMJUiE1DkueM5Yv1bcXTi0 A+B7uxbN4JgQUos7oe1QnUeYEsem X-Google-Smtp-Source: ALg8bN7MyiCS7KbOQgL2MmPVmGz/jX3Ws06MKdxMRW2171espEBAbuxdn4pEICjfwxNlJhxuQ73CPA== X-Received: by 2002:a1c:ef11:: with SMTP id n17mr4001909wmh.112.1548168153690; Tue, 22 Jan 2019 06:42:33 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:33 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli , Christian Couder Subject: [PATCH v2 05/13] promisor-remote: implement promisors_get_direct() Date: Tue, 22 Jan 2019 15:42:04 +0100 Message-Id: <20190122144212.15119-6-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 From: Christian Couder This is implemented for now by calling fetch_objects(). It fetches from all the promisor remotes. Signed-off-by: Christian Couder --- promisor-remote.c | 17 +++++++++++++++++ promisor-remote.h | 1 + 2 files changed, 18 insertions(+) diff --git a/promisor-remote.c b/promisor-remote.c index d2f574651e..f86f9d0b84 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -1,6 +1,7 @@ #include "cache.h" #include "promisor-remote.h" #include "config.h" +#include "fetch-object.h" static struct promisor_remote *promisors; static struct promisor_remote **promisors_tail = &promisors; @@ -98,3 +99,19 @@ int has_promisor_remote(void) { return !!promisor_remote_find(NULL); } + +int promisor_remote_get_direct(const struct object_id *oids, int oid_nr) +{ + struct promisor_remote *o; + + promisor_remote_init(); + + for (o = promisors; o; o = o->next) { + if (fetch_objects(o->remote_name, oids, oid_nr) < 0) + continue; + return 0; + } + + return -1; +} + diff --git a/promisor-remote.h b/promisor-remote.h index bfbf7c0f21..f9f5825417 100644 --- a/promisor-remote.h +++ b/promisor-remote.h @@ -13,5 +13,6 @@ struct promisor_remote { extern struct promisor_remote *promisor_remote_new(const char *remote_name); extern struct promisor_remote *promisor_remote_find(const char *remote_name); extern int has_promisor_remote(void); +extern int promisor_remote_get_direct(const struct object_id *oids, int oid_nr); #endif /* PROMISOR_REMOTE_H */ From patchwork Tue Jan 22 14:42:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775605 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 F3DE81399 for ; Tue, 22 Jan 2019 14:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF7042A19F for ; Tue, 22 Jan 2019 14:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D34212A1F4; Tue, 22 Jan 2019 14:42:39 +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 713E42AA62 for ; Tue, 22 Jan 2019 14:42:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728969AbfAVOmi (ORCPT ); Tue, 22 Jan 2019 09:42:38 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38194 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728917AbfAVOmg (ORCPT ); Tue, 22 Jan 2019 09:42:36 -0500 Received: by mail-wm1-f66.google.com with SMTP id m22so14555529wml.3 for ; Tue, 22 Jan 2019 06:42:35 -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=K8EKzOQkw1/a+/VAoKACgWEZrZTAbWG0UF0Fwu6c+Vk=; b=uGmn6IhxD/47+EuNLxCLUsFebtvFTtoNNLGtvTZfjxuIK7345JqqBsMNedtLgzHrQl Ej+bmmDhl6YWQivTvo3x2JiRq6H1WkCDIikTO044UhZOYICUrAG4j8VKBvtFRIKX4reu lhE8YJrF4ocOM9EcIuVYX2o6bJ3zThJupHh1Z8m+on3BgSAFSOXrY72miw9RUPngrRoj ZgDhSlJlATj5JIaLKnZFpMNMjtgSutAcqk99ByqtIVDkWDX3j13sXNmzfAa/Jxyssig/ W8w+S85iZFiHlQ7JqFHcQcyRJNb8Z3r4LSrsUwd7LLSh7DFVrRoPxD8tQCLrKFtoW0C7 HAXA== 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=K8EKzOQkw1/a+/VAoKACgWEZrZTAbWG0UF0Fwu6c+Vk=; b=TGZtOMOHDwLwoWrjm/f/7DkDPs2Zefmpk7k1GldaAaOobZImk5jXBNqK0LJOzhJxAM AzcNcqGGJQRGzQdIvSkFqqjPmwU4ay9riAT58AltmyNimlZbhHjhcfRYqakf0CmkvPeb K2EiGrV0Gg022JqvdssHorLZxnvPLV6atSVHp7c3UvPDWZMC0OTmVgVBI15NRnhfKDmu g68Oyf99pd80qC6NI1A/TiEE5tk2jL6bdKrJyTZNqWlEar/X4DQHU+DlitjqE0F5F01T aJHo40dOmhNl7FTRZij627l+PCz/UFQH/mOCaYYPrr0zUyGJOAsJJaw1B+N7Xo7ss6l8 bsJg== X-Gm-Message-State: AJcUukdcx+4GNliVMFTRK79iL8xtboWsbGJcwClg5TSEzuqZWftR2o40 WN/ABblm8i6jqKyVMUNCzmaLTUgQ X-Google-Smtp-Source: ALg8bN6jzKc1fVlAodQ1BxcEVxvf5jgqhakXcHyNKHu7DGerZrufH2w8iPI5cIlWGPVuBrffr2QiYw== X-Received: by 2002:a1c:c87:: with SMTP id 129mr3845221wmm.116.1548168154449; Tue, 22 Jan 2019 06:42:34 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:33 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli , Christian Couder Subject: [PATCH v2 06/13] promisor-remote: add promisor_remote_reinit() Date: Tue, 22 Jan 2019 15:42:05 +0100 Message-Id: <20190122144212.15119-7-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 From: Christian Couder We will need to reinitialize the promisor remote configuration as we will make some changes to it in a later commit. Signed-off-by: Christian Couder --- promisor-remote.c | 14 ++++++++++++-- promisor-remote.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/promisor-remote.c b/promisor-remote.c index f86f9d0b84..ea74f6d8a8 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -74,17 +74,27 @@ static int promisor_remote_config(const char *var, const char *value, void *data return 0; } -static void promisor_remote_init(void) +static void promisor_remote_do_init(int force) { static int initialized; - if (initialized) + if (!force && initialized) return; initialized = 1; git_config(promisor_remote_config, NULL); } +static inline void promisor_remote_init(void) +{ + promisor_remote_do_init(0); +} + +void promisor_remote_reinit(void) +{ + promisor_remote_do_init(1); +} + struct promisor_remote *promisor_remote_find(const char *remote_name) { promisor_remote_init(); diff --git a/promisor-remote.h b/promisor-remote.h index f9f5825417..f96722bc66 100644 --- a/promisor-remote.h +++ b/promisor-remote.h @@ -10,6 +10,7 @@ struct promisor_remote { struct promisor_remote *next; }; +extern void promisor_remote_reinit(void); extern struct promisor_remote *promisor_remote_new(const char *remote_name); extern struct promisor_remote *promisor_remote_find(const char *remote_name); extern int has_promisor_remote(void); From patchwork Tue Jan 22 14:42:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775607 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 92D101399 for ; Tue, 22 Jan 2019 14:42:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 819BA2A19F for ; Tue, 22 Jan 2019 14:42:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 758812A3C9; Tue, 22 Jan 2019 14:42:42 +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 0820A2A19F for ; Tue, 22 Jan 2019 14:42:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728966AbfAVOmk (ORCPT ); Tue, 22 Jan 2019 09:42:40 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40689 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728807AbfAVOmh (ORCPT ); Tue, 22 Jan 2019 09:42:37 -0500 Received: by mail-wm1-f67.google.com with SMTP id f188so14406013wmf.5 for ; Tue, 22 Jan 2019 06:42:36 -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=1cnF8jR2820ojq6y7rJUTSkpzvd2fiFQ53mxqcy6Tzg=; b=mTTGopzNQgDXUPvuPAgW1RVAaRIyHraIZBKXjB8FkbgBByekWhHPSCpGQuNRnEJpDt DBinkF8hdrac0um4h+kpkCydZCeezHTp/ynoY6DayR2/5Y5QERfPccyEhwnUvtYHlOjk SM5QIgnlxz2obWYU6HnuuljGfwsRq/TmwZKoJXs9Ccg+quASriBWfEKTKkyjss8Lz4wD OfpoPZpoieaf5mUzeM7FJgSoR89VD2uF1YFwhVvLVL7xkKuWzp7DIp7eUoaXirFQ3nYe MBIXJnvv1cTCzo7FANTXxDgpWdP85ot8a2QBP006vq3SuB0M4pdpCQFbtnpTTe6+VqfO JLXA== 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=1cnF8jR2820ojq6y7rJUTSkpzvd2fiFQ53mxqcy6Tzg=; b=CortpOFfJj/nlsORYN3UTGeeuAgfP8sXRCpbTWmLu1p7+AMFR8e0C5QPPUILs38mFc WyXgf1bSR2ugtuq7nWN1q+94lEgSMIuLp49TBVeUOlnjmWPNc3+4UXG/Peo8EVehr2Oa 3ectdprHCB52cob42DBo9uTvmB2n5LEkKfMCGXFbz40rjIUtL99ah5ldjVUqscb2Lvqk fPluYITyZ3LT3STY8eL+KONpaUEUxwFmhPnMOiWvHAimxADwn0zgDHRrWS84JZ/4Gyjt d/0tXqXZ59iFbkCv+bmaibf/iKyDrmpO6tO0IwpjNV/3fCMqsir6ig6F9Qaaa5JyIRn4 iCWA== X-Gm-Message-State: AJcUukevGvEWnC76iK0iVaEam2pi2M7a77DJ1Qd0YmvB1875i4vJPatT adM5DCipzkPVAHTO94LyayBM5bqL X-Google-Smtp-Source: ALg8bN5lHZ59t9sK0oDPXLY7CAMjFeZ1TaMA8GnWuSl64ra0AP6oL8IiM7bjNcEdJYi7Zyjee0Pctw== X-Received: by 2002:a1c:1902:: with SMTP id 2mr4115209wmz.150.1548168155177; Tue, 22 Jan 2019 06:42:35 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:34 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 07/13] promisor-remote: use repository_format_partial_clone Date: Tue, 22 Jan 2019 15:42:06 +0100 Message-Id: <20190122144212.15119-8-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 A remote specified using the extensions.partialClone config option should be considered a promisor remote too. This remote should be at the end of the promisor remote list, so that it is used only if objects have not been found in other remotes. Signed-off-by: Christian Couder --- promisor-remote.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/promisor-remote.c b/promisor-remote.c index ea74f6d8a8..dcf6ef6521 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -83,6 +83,17 @@ static void promisor_remote_do_init(int force) initialized = 1; git_config(promisor_remote_config, NULL); + + if (repository_format_partial_clone) { + struct promisor_remote *o, *previous; + + o = promisor_remote_look_up(repository_format_partial_clone, + &previous); + if (o) + promisor_remote_move_to_tail(o, previous); + else + promisor_remote_new(repository_format_partial_clone); + } } static inline void promisor_remote_init(void) From patchwork Tue Jan 22 14:42:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775621 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 B0E3B13B5 for ; Tue, 22 Jan 2019 14:42:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EF752A1F4 for ; Tue, 22 Jan 2019 14:42:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92E062AA5F; Tue, 22 Jan 2019 14:42:51 +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 9F8632A1F4 for ; Tue, 22 Jan 2019 14:42:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728993AbfAVOms (ORCPT ); Tue, 22 Jan 2019 09:42:48 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:53072 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728967AbfAVOmj (ORCPT ); Tue, 22 Jan 2019 09:42:39 -0500 Received: by mail-wm1-f66.google.com with SMTP id m1so14400591wml.2 for ; Tue, 22 Jan 2019 06:42:37 -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=dQbhMiCSwYZVcxMZKtjC+L6u+Euw9jahXFtqmfU51js=; b=jHORMXmqOhXDw5iHoU/WdVbwf/GS0zbX7jiYAJRkclM8lgNeuSaqOKUxmAddxR1xai 4SXvjkAvQNqZmVeTAmoSEvqy/p20UudowNoxjZ9x5Fr+OrTpYEHsvq1SwjRNf1konCBJ aCXp0JYbhBQEoSbzOJ40Sn5OwZ9phNqSI1TtI/j/nOf3dlxpzt64wpDnmphOHEj8rHnN HB3NsGDT+LqVG5zvdFNzSmfr7qWqCCHT59MN8LzT1dLYwWuwJ0B4DwWO1nDs+MdkSBj6 UNLHkHSmRBzqgoQGskudHWfr0YNi5nRk6flr2oK1ebpK9tBCjoXeCh3rqNO+6kaz71Nt KzUg== 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=dQbhMiCSwYZVcxMZKtjC+L6u+Euw9jahXFtqmfU51js=; b=mEOLY/efdGs0UKTOMZwaeOG3N2/oNaLw5ZAuVQYQaPwvBteb/rGASbrR/OkPN/BfHS Bu7DTsrVgqaqwtnePOWB0AlJ7g+cW7q1YUub+iIQ0I+A2eM9hFgyngjucw7vkjhzd/ip awlsHp3RJJzCHtrlT52+lGgLeEli4VzyKrW8WsLwK/4/rBaGYBdlYVJlPf498ygpFVFg UcwqgoZDyTSg/OnMJ0ykzqdFVd5BcuaxR7nthylSVnCNg/VPvc34CdfhYbIP0UKCnWGf rIoKNOIiDUV5/k6lO/QsOhiaPC/FP1lVjroqeDvy2cEQ8gFq7Yoe0NbkOlacwsZtqkDi 3Qmw== X-Gm-Message-State: AJcUukcTRa39RAKIHcSoQpcBM/tXdTW0KCpdODwQNcNU6L+L/j7OVoSZ h7jPzRVMoxLfnL4An4B6fNE8tb4w X-Google-Smtp-Source: ALg8bN6i67BThfVs5ZOaQyNO0LnnIMWeMtrlWVoDLffvLucGgSoj9h1K3LJMWTnHSlgFDVwRXbG2kw== X-Received: by 2002:a1c:6e06:: with SMTP id j6mr4202152wmc.3.1548168156309; Tue, 22 Jan 2019 06:42:36 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:35 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 08/13] Use promisor_remote_get_direct() and has_promisor_remote() Date: Tue, 22 Jan 2019 15:42:07 +0100 Message-Id: <20190122144212.15119-9-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 Instead of using the repository_format_partial_clone global and fetch_objects() directly, let's use has_promisor_remote() and promisor_remote_get_direct(). This way all the configured promisor remotes will be taken into account, not only the one specified by extensions.partialClone. Also when cloning or fetching using a partial clone filter, remote.origin.promisor will be set to "true" instead of setting extensions.partialClone to "origin". This makes it possible to use many promisor remote just by fetching from them. Signed-off-by: Christian Couder --- builtin/cat-file.c | 5 +++-- builtin/fetch.c | 11 ++++++----- builtin/gc.c | 3 ++- builtin/repack.c | 3 ++- cache-tree.c | 3 ++- connected.c | 3 ++- list-objects-filter-options.c | 28 +++++++++++++++------------- packfile.c | 3 ++- sha1-file.c | 14 ++++++++------ t/t5601-clone.sh | 2 +- t/t5616-partial-clone.sh | 2 +- unpack-trees.c | 6 +++--- 12 files changed, 47 insertions(+), 36 deletions(-) diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 2ca56fd086..bdb0331ba4 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -14,6 +14,7 @@ #include "sha1-array.h" #include "packfile.h" #include "object-store.h" +#include "promisor-remote.h" struct batch_options { int enabled; @@ -517,8 +518,8 @@ static int batch_objects(struct batch_options *opt) if (opt->all_objects) { struct object_cb_data cb; - if (repository_format_partial_clone) - warning("This repository has extensions.partialClone set. Some objects may not be loaded."); + if (has_promisor_remote()) + warning("This repository uses promisor remotes. Some objects may not be loaded."); cb.opt = opt; cb.expand = &data; diff --git a/builtin/fetch.c b/builtin/fetch.c index c0ade48f5d..d327cd9ef5 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -23,6 +23,7 @@ #include "packfile.h" #include "list-objects-filter-options.h" #include "commit-reach.h" +#include "promisor-remote.h" static const char * const builtin_fetch_usage[] = { N_("git fetch [] [ [...]]"), @@ -1459,7 +1460,7 @@ static inline void fetch_one_setup_partial(struct remote *remote) * If no prior partial clone/fetch and the current fetch DID NOT * request a partial-fetch, do a normal fetch. */ - if (!repository_format_partial_clone && !filter_options.choice) + if (!has_promisor_remote() && !filter_options.choice) return; /* @@ -1467,7 +1468,7 @@ static inline void fetch_one_setup_partial(struct remote *remote) * on this repo and remember the given filter-spec as the default * for subsequent fetches to this remote. */ - if (!repository_format_partial_clone && filter_options.choice) { + if (!has_promisor_remote() && filter_options.choice) { partial_clone_register(remote->name, &filter_options); return; } @@ -1476,7 +1477,7 @@ static inline void fetch_one_setup_partial(struct remote *remote) * We are currently limited to only ONE promisor remote and only * allow partial-fetches from the promisor remote. */ - if (strcmp(remote->name, repository_format_partial_clone)) { + if (!promisor_remote_find(remote->name)) { if (filter_options.choice) die(_("--filter can only be used with the remote " "configured in extensions.partialclone")); @@ -1608,7 +1609,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) if (depth || deepen_since || deepen_not.nr) deepen = 1; - if (filter_options.choice && !repository_format_partial_clone) + if (filter_options.choice && !has_promisor_remote()) die("--filter can only be used when extensions.partialClone is set"); if (all) { @@ -1642,7 +1643,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) } if (remote) { - if (filter_options.choice || repository_format_partial_clone) + if (filter_options.choice || has_promisor_remote()) fetch_one_setup_partial(remote); result = fetch_one(remote, argc, argv, prune_tags_ok); } else { diff --git a/builtin/gc.c b/builtin/gc.c index 020f725acc..0bec41b25f 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -27,6 +27,7 @@ #include "pack-objects.h" #include "blob.h" #include "tree.h" +#include "promisor-remote.h" #define FAILED_RUN "failed to run %s" @@ -640,7 +641,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) argv_array_push(&prune, prune_expire); if (quiet) argv_array_push(&prune, "--no-progress"); - if (repository_format_partial_clone) + if (has_promisor_remote()) argv_array_push(&prune, "--exclude-promisor-objects"); if (run_command_v_opt(prune.argv, RUN_GIT_CMD)) diff --git a/builtin/repack.c b/builtin/repack.c index 67f8978043..3b935690c8 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -11,6 +11,7 @@ #include "midx.h" #include "packfile.h" #include "object-store.h" +#include "promisor-remote.h" static int delta_base_offset = 1; static int pack_kept_objects = -1; @@ -366,7 +367,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix) argv_array_push(&cmd.args, "--all"); argv_array_push(&cmd.args, "--reflog"); argv_array_push(&cmd.args, "--indexed-objects"); - if (repository_format_partial_clone) + if (has_promisor_remote()) argv_array_push(&cmd.args, "--exclude-promisor-objects"); if (write_bitmaps) argv_array_push(&cmd.args, "--write-bitmap-index"); diff --git a/cache-tree.c b/cache-tree.c index eabb8fb654..3e79e22b3d 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -5,6 +5,7 @@ #include "cache-tree.h" #include "object-store.h" #include "replace-object.h" +#include "promisor-remote.h" #ifndef DEBUG #define DEBUG 0 @@ -357,7 +358,7 @@ static int update_one(struct cache_tree *it, } ce_missing_ok = mode == S_IFGITLINK || missing_ok || - (repository_format_partial_clone && + (has_promisor_remote() && ce_skip_worktree(ce)); if (is_null_oid(oid) || (!ce_missing_ok && !has_object_file(oid))) { diff --git a/connected.c b/connected.c index 1bba888eff..0eaaedee6a 100644 --- a/connected.c +++ b/connected.c @@ -4,6 +4,7 @@ #include "connected.h" #include "transport.h" #include "packfile.h" +#include "promisor-remote.h" /* * If we feed all the commits we want to verify to this command @@ -56,7 +57,7 @@ int check_connected(oid_iterate_fn fn, void *cb_data, argv_array_push(&rev_list.args,"rev-list"); argv_array_push(&rev_list.args, "--objects"); argv_array_push(&rev_list.args, "--stdin"); - if (repository_format_partial_clone) + if (has_promisor_remote()) argv_array_push(&rev_list.args, "--exclude-promisor-objects"); if (!opt->is_deepening_fetch) { argv_array_push(&rev_list.args, "--not"); diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index e8da2e8581..4e6b47b177 100644 --- a/list-objects-filter-options.c +++ b/list-objects-filter-options.c @@ -6,6 +6,7 @@ #include "list-objects.h" #include "list-objects-filter.h" #include "list-objects-filter-options.h" +#include "promisor-remote.h" /* * Parse value of the argument to the "filter" keyword. @@ -125,30 +126,31 @@ void partial_clone_register( const char *remote, const struct list_objects_filter_options *filter_options) { - /* - * Record the name of the partial clone remote in the - * config and in the global variable -- the latter is - * used throughout to indicate that partial clone is - * enabled and to expect missing objects. - */ - if (repository_format_partial_clone && - *repository_format_partial_clone && - strcmp(remote, repository_format_partial_clone)) - die(_("cannot change partial clone promisor remote")); + char *cfg_name; - git_config_set("core.repositoryformatversion", "1"); - git_config_set("extensions.partialclone", remote); + /* Check if it is already registered */ + if (!promisor_remote_find(remote)) { + git_config_set("core.repositoryformatversion", "1"); - repository_format_partial_clone = xstrdup(remote); + /* Add promisor config for the remote */ + cfg_name = xstrfmt("remote.%s.promisor", remote); + git_config_set(cfg_name, "true"); + free(cfg_name); + } /* * Record the initial filter-spec in the config as * the default for subsequent fetches from this remote. + * + * TODO: record it into remote..partialclonefilter */ core_partial_clone_filter_default = xstrdup(filter_options->filter_spec); git_config_set("core.partialclonefilter", core_partial_clone_filter_default); + + /* Make sure the config info are reset */ + promisor_remote_reinit(); } void partial_clone_get_default_filter_spec( diff --git a/packfile.c b/packfile.c index 0fe9c21bf1..128d31d94b 100644 --- a/packfile.c +++ b/packfile.c @@ -16,6 +16,7 @@ #include "tree.h" #include "object-store.h" #include "midx.h" +#include "promisor-remote.h" char *odb_pack_name(struct strbuf *buf, const unsigned char *sha1, @@ -2118,7 +2119,7 @@ int is_promisor_object(const struct object_id *oid) static int promisor_objects_prepared; if (!promisor_objects_prepared) { - if (repository_format_partial_clone) { + if (has_promisor_remote()) { for_each_packed_object(add_promisor_object, &promisor_objects, FOR_EACH_OBJECT_PROMISOR_ONLY); diff --git a/sha1-file.c b/sha1-file.c index 972f26e931..2a786f1067 100644 --- a/sha1-file.c +++ b/sha1-file.c @@ -32,6 +32,7 @@ #include "packfile.h" #include "fetch-object.h" #include "object-store.h" +#include "promisor-remote.h" /* The maximum size for an object header. */ #define MAX_HEADER_LEN 32 @@ -1301,15 +1302,16 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid, } /* Check if it is a missing object */ - if (fetch_if_missing && repository_format_partial_clone && + if (fetch_if_missing && has_promisor_remote() && !already_retried && r == the_repository) { /* - * TODO Investigate checking fetch_object() return - * TODO value and stopping on error here. - * TODO Pass a repository struct through fetch_object, - * such that arbitrary repositories work. + * TODO Investigate checking promisor_remote_get_direct() + * TODO return value and stopping on error here. + * TODO Pass a repository struct through + * promisor_remote_get_direct(), such that arbitrary + * repositories work. */ - fetch_objects(repository_format_partial_clone, real, 1); + promisor_remote_get_direct(real, 1); already_retried = 1; continue; } diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index d6948cbdab..dd658f8b32 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -653,7 +653,7 @@ partial_clone () { git -C client fsck && # Ensure that unneeded blobs are not inadvertently fetched. - test_config -C client extensions.partialclone "not a remote" && + test_config -C client remote.origin.promisor "false" && test_must_fail git -C client cat-file -e "$HASH1" && # But this blob was fetched, because clone performs an initial checkout diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index 9643acb161..e8ca825ab7 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -42,7 +42,7 @@ test_expect_success 'do partial clone 1' ' test_cmp expect_1.oids observed.oids && test "$(git -C pc1 config --local core.repositoryformatversion)" = "1" && - test "$(git -C pc1 config --local extensions.partialclone)" = "origin" && + test "$(git -C pc1 config --local remote.origin.promisor)" = "true" && test "$(git -C pc1 config --local core.partialclonefilter)" = "blob:none" ' diff --git a/unpack-trees.c b/unpack-trees.c index 94265a7df0..7e89cc28f9 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -18,6 +18,7 @@ #include "fsmonitor.h" #include "object-store.h" #include "fetch-object.h" +#include "promisor-remote.h" /* * Error messages expected by scripts out of plumbing commands such as @@ -418,7 +419,7 @@ static int check_updates(struct unpack_trees_options *o) load_gitmodules_file(index, &state); enable_delayed_checkout(&state); - if (repository_format_partial_clone && o->update && !o->dry_run) { + if (has_promisor_remote() && o->update && !o->dry_run) { /* * Prefetch the objects that are to be checked out in the loop * below. @@ -435,8 +436,7 @@ static int check_updates(struct unpack_trees_options *o) } } if (to_fetch.nr) - fetch_objects(repository_format_partial_clone, - to_fetch.oid, to_fetch.nr); + promisor_remote_get_direct(to_fetch.oid, to_fetch.nr); fetch_if_missing = fetch_if_missing_store; oid_array_clear(&to_fetch); } From patchwork Tue Jan 22 14:42:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775617 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 1BC1113B5 for ; Tue, 22 Jan 2019 14:42:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B80D2A1F4 for ; Tue, 22 Jan 2019 14:42:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F30A42AA62; Tue, 22 Jan 2019 14:42:48 +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 6219F2A3C9 for ; Tue, 22 Jan 2019 14:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728988AbfAVOmr (ORCPT ); Tue, 22 Jan 2019 09:42:47 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:43263 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728970AbfAVOmk (ORCPT ); Tue, 22 Jan 2019 09:42:40 -0500 Received: by mail-wr1-f67.google.com with SMTP id r10so27589800wrs.10 for ; Tue, 22 Jan 2019 06:42:38 -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=VZRENqqB1Cr05lFyho5k6QBIbX3AIqDSaA42cqBx5AI=; b=fwL6HfNnc/Xlpqsm7kxWcP87eQLsyaR7AJ0BZdx7ZGQpMALKDpNNpPmmoM3cUWbUX6 q2C+EHkJ3T7sWSo8JIEmgIjeCDetETFmK4tu8+2WnOSn6i4b2U4nl+e2TIQzCoeDno1a SxCYSnv1Di+6vpdX4NZLXU5AoPfHh1b179PlPmc1QQr6tQKLXNasWx2y8Hxeokh3WpEM kI3C3A5Qo1f1SBJU4+fX0fRnBNis+AF++0F+TIXmzFLdis0JJfixcWKXqH9iH2OIDDD/ nv18k/pjxFGoXS1VDnMNhGYPPDrBO0jixaC4pU3EdprWNH9aOcUD/PMpYYsgjaG4MpWo UVtA== 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=VZRENqqB1Cr05lFyho5k6QBIbX3AIqDSaA42cqBx5AI=; b=poL30Dt8wpWulM3EtA6Ewzt3alFEIv+iNxDC7mIINqJVvC0PWx+FOnB6L6OSv/yinH 5yJJ/MnCoppu0A7SYqzUdriSFFTS4A4zRzAhvwSJtwkh+wSlL0Hj8Rg15cBjinIr6r45 FeYSY6sUsQLF6zPFQav8CL+dqF3jS3Z5t5qmAk7T14qv2G00cS5LPKjRi5DNQvQ1IpkM uhl47txMxn4xowJ9cR0atf9+us7A5fpaobBCuIp0d2G51HVJxclfZrRRM9+uT0c+q7Hq d8DdIqzo6p7Yd9jUaODN+VU8jPCUKznCe8oT6+ddC35BBd3+GuuDV0oWjiR94Hm3ExXQ pLcw== X-Gm-Message-State: AJcUukeRVte0OKMZxz7vUBDB0yaKJEcMh8/+kJVtQs0qCm6I5k6LJ4yz czVTIXsX90yfe2agePNFKqOP8lMi X-Google-Smtp-Source: ALg8bN5Y7RvQGy81j7U4w3blPwZLmu51UpR7QiuPdXQKis1KevsUO89EUB5371qD9p2XKt/oQTZHEA== X-Received: by 2002:adf:b502:: with SMTP id a2mr35222324wrd.54.1548168157101; Tue, 22 Jan 2019 06:42:37 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:36 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 09/13] promisor-remote: parse remote.*.partialclonefilter Date: Tue, 22 Jan 2019 15:42:08 +0100 Message-Id: <20190122144212.15119-10-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 This makes it possible to specify a different partial clone filter for each promisor remote. Signed-off-by: Christian Couder --- builtin/fetch.c | 2 +- list-objects-filter-options.c | 27 +++++++++++++++------------ list-objects-filter-options.h | 3 ++- promisor-remote.c | 10 ++++++++++ promisor-remote.h | 5 ++++- t/t0410-partial-clone.sh | 2 +- t/t5601-clone.sh | 1 + t/t5616-partial-clone.sh | 2 +- 8 files changed, 35 insertions(+), 17 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index d327cd9ef5..75746c50e0 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1490,7 +1490,7 @@ static inline void fetch_one_setup_partial(struct remote *remote) * the config. */ if (!filter_options.choice) - partial_clone_get_default_filter_spec(&filter_options); + partial_clone_get_default_filter_spec(&filter_options, remote->name); return; } diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c index 4e6b47b177..a70a16bf5c 100644 --- a/list-objects-filter-options.c +++ b/list-objects-filter-options.c @@ -29,6 +29,9 @@ static int gently_parse_list_objects_filter( { const char *v0; + if (!arg) + return 0; + if (filter_options->choice) { if (errbuf) { strbuf_addstr( @@ -127,6 +130,7 @@ void partial_clone_register( const struct list_objects_filter_options *filter_options) { char *cfg_name; + char *filter_name; /* Check if it is already registered */ if (!promisor_remote_find(remote)) { @@ -141,27 +145,26 @@ void partial_clone_register( /* * Record the initial filter-spec in the config as * the default for subsequent fetches from this remote. - * - * TODO: record it into remote..partialclonefilter */ - core_partial_clone_filter_default = - xstrdup(filter_options->filter_spec); - git_config_set("core.partialclonefilter", - core_partial_clone_filter_default); + filter_name = xstrfmt("remote.%s.partialclonefilter", remote); + git_config_set(filter_name, filter_options->filter_spec); + free(filter_name); /* Make sure the config info are reset */ promisor_remote_reinit(); } void partial_clone_get_default_filter_spec( - struct list_objects_filter_options *filter_options) + struct list_objects_filter_options *filter_options, + const char *remote) { + struct promisor_remote *promisor = promisor_remote_find(remote); + /* * Parse default value, but silently ignore it if it is invalid. */ - if (!core_partial_clone_filter_default) - return; - gently_parse_list_objects_filter(filter_options, - core_partial_clone_filter_default, - NULL); + if (promisor) + gently_parse_list_objects_filter(filter_options, + promisor->partial_clone_filter, + NULL); } diff --git a/list-objects-filter-options.h b/list-objects-filter-options.h index af64e5c66f..8c10ec2d3a 100644 --- a/list-objects-filter-options.h +++ b/list-objects-filter-options.h @@ -75,6 +75,7 @@ void partial_clone_register( const char *remote, const struct list_objects_filter_options *filter_options); void partial_clone_get_default_filter_spec( - struct list_objects_filter_options *filter_options); + struct list_objects_filter_options *filter_options, + const char *remote); #endif /* LIST_OBJECTS_FILTER_OPTIONS_H */ diff --git a/promisor-remote.c b/promisor-remote.c index dcf6ef6521..ed33dfa86c 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -70,6 +70,16 @@ static int promisor_remote_config(const char *var, const char *value, void *data free(remote_name); return 0; } + if (!strcmp(subkey, "partialclonefilter")) { + char *remote_name = xmemdupz(name, namelen); + + o = promisor_remote_look_up(remote_name, NULL); + if (!o) + o = promisor_remote_new(remote_name); + + free(remote_name); + return git_config_string(&o->partial_clone_filter, var, value); + } return 0; } diff --git a/promisor-remote.h b/promisor-remote.h index f96722bc66..f0d609a3f5 100644 --- a/promisor-remote.h +++ b/promisor-remote.h @@ -3,10 +3,13 @@ /* * Promisor remote linked list - * Its information come from remote.XXX config entries. + * + * Information in its fields come from remote.XXX config entries or + * from extensions.partialclone or core.partialclonefilter. */ struct promisor_remote { const char *remote_name; + const char *partial_clone_filter; struct promisor_remote *next; }; diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index bce02788e6..9266037714 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -26,7 +26,7 @@ promise_and_delete () { test_expect_success 'extensions.partialclone without filter' ' test_create_repo server && git clone --filter="blob:none" "file://$(pwd)/server" client && - git -C client config --unset core.partialclonefilter && + git -C client config --unset remote.origin.partialclonefilter && git -C client fetch origin ' diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index dd658f8b32..2e82c70f33 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -654,6 +654,7 @@ partial_clone () { # Ensure that unneeded blobs are not inadvertently fetched. test_config -C client remote.origin.promisor "false" && + git -C client config --unset remote.origin.partialclonefilter && test_must_fail git -C client cat-file -e "$HASH1" && # But this blob was fetched, because clone performs an initial checkout diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index e8ca825ab7..ba0489b41a 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -43,7 +43,7 @@ test_expect_success 'do partial clone 1' ' test_cmp expect_1.oids observed.oids && test "$(git -C pc1 config --local core.repositoryformatversion)" = "1" && test "$(git -C pc1 config --local remote.origin.promisor)" = "true" && - test "$(git -C pc1 config --local core.partialclonefilter)" = "blob:none" + test "$(git -C pc1 config --local remote.origin.partialclonefilter)" = "blob:none" ' # checkout master to force dynamic object fetch of blobs at HEAD. From patchwork Tue Jan 22 14:42:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775619 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 5ABC917F0 for ; Tue, 22 Jan 2019 14:42:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A7A82A1F4 for ; Tue, 22 Jan 2019 14:42:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DD642A3C9; Tue, 22 Jan 2019 14:42:49 +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 E638E2AA5F for ; Tue, 22 Jan 2019 14:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728990AbfAVOms (ORCPT ); Tue, 22 Jan 2019 09:42:48 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:36648 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728833AbfAVOmk (ORCPT ); Tue, 22 Jan 2019 09:42:40 -0500 Received: by mail-wr1-f42.google.com with SMTP id u4so27651164wrp.3 for ; Tue, 22 Jan 2019 06:42:39 -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=WVJxXAEBOVQVdJc9P/Qb7EZQRGeBngAdYMOrmxK5lho=; b=oa+M5oLTnIiYwy3os13P3p1FvHKfSOURJduGBNz+X+36DqMdbGLRd/EseUg+6OilnU 0DkUAupD1Y2a2iM0H3WGoc6gFgz4gilxwYfZvI3VJ/gWeIc4vWy/FN5uw6NxeP19zBkx 8sXYuarBw/i38U7XzPvEWyfF8xK4jrYV95/fAUflLHL1LwPhKvomo3bu7madnrM8618N ggQHnMDp7nqGL4zQZ0HDP+9bDezAYSRRjrCcMWzbWrqPhC4CbtHd7XEkbt1WbCbW8fjx pwR+ucNrgobukpSV0JvOpXKVufuoVrLYGEBmvCjzVpXkngpY9j1bd3L8jwFZ0KC28Fof 2wNg== 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=WVJxXAEBOVQVdJc9P/Qb7EZQRGeBngAdYMOrmxK5lho=; b=owIxfkoR9s8+G6ZFem0JBu0++5NQ8gJO7kcBuRqJhJsXv2RTmpOJnKYD/AZIg/n8RJ r4G7IawGPYt2gq4QqDK7eXiCeZnBtBfW+IgciO27gQfuYN5ucwVGouv+xA+aJwlDP0UO G9UAWCKFicIU2tz/gWTJo/mzBmj5n1Y9XVSBS/6WrlZTJ5tXKPCjI2L18dZ/HrTvchDp 6HtXKhon/C7UEHBdofKlZ6VX/h0pCg3J1ZN/B92fayOQDWg/eUJNLa+kxv3rCJKekUEC 3ZNvEgiMSs9tjEdygu5N7G4aipDqfZOl7a71S5OO1326QGcx4dVi34yop/ac06SYJqdj NAkw== X-Gm-Message-State: AJcUukeMV7Dr2TEAgUEyj2W6Tqxfw9FAUm7+eANIn9ZWVp33n9LUCfuJ lAldbnxw+jvx36HEMGzIeZsdzgJj X-Google-Smtp-Source: ALg8bN7qRdQQBbdZQnGUZ2hSd0HQAlW4M+W7BeG7+A2F6enM7ylpUErU9FE9urYOv3aJnW16yESJDA== X-Received: by 2002:adf:dcd0:: with SMTP id x16mr32667504wrm.143.1548168157788; Tue, 22 Jan 2019 06:42:37 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:37 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 10/13] builtin/fetch: remove unique promisor remote limitation Date: Tue, 22 Jan 2019 15:42:09 +0100 Message-Id: <20190122144212.15119-11-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 --- builtin/fetch.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index 75746c50e0..ed883399c7 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1464,26 +1464,16 @@ static inline void fetch_one_setup_partial(struct remote *remote) return; /* - * If this is the FIRST partial-fetch request, we enable partial - * on this repo and remember the given filter-spec as the default - * for subsequent fetches to this remote. + * If this is a partial-fetch request, we enable partial on + * this repo if not already enabled and remember the given + * filter-spec as the default for subsequent fetches to this + * remote. */ - if (!has_promisor_remote() && filter_options.choice) { + if (filter_options.choice) { partial_clone_register(remote->name, &filter_options); return; } - /* - * We are currently limited to only ONE promisor remote and only - * allow partial-fetches from the promisor remote. - */ - if (!promisor_remote_find(remote->name)) { - if (filter_options.choice) - die(_("--filter can only be used with the remote " - "configured in extensions.partialclone")); - return; - } - /* * Do a partial-fetch from the promisor remote using either the * explicitly given filter-spec or inherit the filter-spec from From patchwork Tue Jan 22 14:42:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775613 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 C4AB013B5 for ; Tue, 22 Jan 2019 14:42:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B11F42A19F for ; Tue, 22 Jan 2019 14:42:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A559A2AA5F; Tue, 22 Jan 2019 14:42:47 +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 42B742A19F for ; Tue, 22 Jan 2019 14:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728984AbfAVOmq (ORCPT ); Tue, 22 Jan 2019 09:42:46 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38236 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728774AbfAVOml (ORCPT ); Tue, 22 Jan 2019 09:42:41 -0500 Received: by mail-wr1-f67.google.com with SMTP id v13so27651679wrw.5 for ; Tue, 22 Jan 2019 06:42:39 -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=YdPS5vfZkOgxh/503xS90GmTxksvsOwVKoDyalky5hU=; b=gtAfK2JX+uJtuYRBBbN2xq80XX9VJdaHOwYg2MgZpPZC5jO2yfAEf+VtN/V9NVpKpo dugt9LRymjUR4oCbhs43iJiGvZ/l/YflczMa9kyJtauDVsjAIj9sNxau4IQ+uOo9cU4d Ww/6mznmAsTI+Xqo8PWREM/SOpbj92QncGqg2AagVWxLlMur174parHbxV/pWid99ZfX O2ub4aHMCWKQcNnRr5PTcY+O60zuVqcJDLm6rEK1CoWtnBr0D7dgbvvzEP0eEjEiv+/C AUtgIXVhtpsHCzBFXmx2e9rnGN9oZj0r64l+7TC14roXZ50LDlFLG08DnIf/RpRPw0Eb s+vQ== 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=YdPS5vfZkOgxh/503xS90GmTxksvsOwVKoDyalky5hU=; b=T98VN6bXvWlKHxuknDRljwtWmLEXZLlnqA23aLWy7yHMu4Ga4pn779IBU/BtYoRu6f tUEme0IE5asHASkHwDe6npZPScHLVOGBMLSphDwle4jZVbDXBJud74s09wcbiI5AW/XN 657lxQkG51ZxnEu7HrlrpuqEd30XfwjwhEIJ7zHmYaxy3HxgFOgpiv+c2bXZ1V0swCAF 8pq/k0B+WTYl5T6XayZfUu9TUA5VzSk3ITvfXrwqKXIy89zy0nqCJFgJU8ar/wDIF3bm YRL2rbn7dP1z4PzQmy0egeOAWSvBERzqdXAR/zZBlf8ZcQK1dVn5HrarvOLQ0eY+aOpx GTWg== X-Gm-Message-State: AJcUukeQLF6PtAhJBWA6elWunmdKEpbiwERE+LhLAxPsQf6uRThGrkMv MI4coIbL46eV6x5v41JmIjZj5NBH X-Google-Smtp-Source: ALg8bN7gn6rNBZYDb8bKF6nmuKKDSWCN7I38fUj5ZBV0Nhi0GL5ahvuUAvHiUA1ww097eTx0kw1I+Q== X-Received: by 2002:adf:d146:: with SMTP id b6mr33373445wri.156.1548168158984; Tue, 22 Jan 2019 06:42:38 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:37 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli , Christian Couder Subject: [PATCH v2 11/13] t0410: test fetching from many promisor remotes Date: Tue, 22 Jan 2019 15:42:10 +0100 Message-Id: <20190122144212.15119-12-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 From: Christian Couder This shows that it is now possible to fetch objects from more than one promisor remote, and that fetching from a new promisor remote can configure it as one. Signed-off-by: Christian Couder --- t/t0410-partial-clone.sh | 47 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index 9266037714..146b0a1e03 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -182,8 +182,53 @@ test_expect_success 'fetching of missing objects works with ref-in-want enabled' grep "git< fetch=.*ref-in-want" trace ' +test_expect_success 'fetching of missing objects from another promisor remote' ' + git clone "file://$(pwd)/server" server2 && + test_commit -C server2 bar && + git -C server2 repack -a -d --write-bitmap-index && + HASH2=$(git -C server2 rev-parse bar) && + + git -C repo remote add server2 "file://$(pwd)/server2" && + git -C repo config remote.server2.promisor true && + git -C repo cat-file -p "$HASH2" && + + git -C repo fetch server2 && + rm -rf repo/.git/objects/* && + git -C repo cat-file -p "$HASH2" && + + # Ensure that the .promisor file is written, and check that its + # associated packfile contains the object + ls repo/.git/objects/pack/pack-*.promisor >promisorlist && + test_line_count = 1 promisorlist && + IDX=$(cat promisorlist | sed "s/promisor$/idx/") && + git verify-pack --verbose "$IDX" | grep "$HASH2" +' + +test_expect_success 'fetching of missing objects configures a promisor remote' ' + git clone "file://$(pwd)/server" server3 && + test_commit -C server3 baz && + git -C server3 repack -a -d --write-bitmap-index && + HASH3=$(git -C server3 rev-parse baz) && + git -C server3 config uploadpack.allowfilter 1 && + + rm repo/.git/objects/pack/pack-*.promisor && + + git -C repo remote add server3 "file://$(pwd)/server3" && + git -C repo fetch --filter="blob:none" server3 $HASH3 && + + test "$(git -C repo config remote.server3.promisor)" = "true" && + + # Ensure that the .promisor file is written, and check that its + # associated packfile contains the object + ls repo/.git/objects/pack/pack-*.promisor >promisorlist && + test_line_count = 1 promisorlist && + IDX=$(cat promisorlist | sed "s/promisor$/idx/") && + git verify-pack --verbose "$IDX" | grep "$HASH3" +' + test_expect_success 'fetching of missing blobs works' ' - rm -rf server repo && + rm -rf server server2 repo && + rm -rf server server3 repo && test_create_repo server && test_commit -C server foo && git -C server repack -a -d --write-bitmap-index && From patchwork Tue Jan 22 14:42:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775623 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 5052A1399 for ; Tue, 22 Jan 2019 14:42:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AEC62A1F4 for ; Tue, 22 Jan 2019 14:42:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D84F2AA5F; Tue, 22 Jan 2019 14:42:54 +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 854FA2A1F4 for ; Tue, 22 Jan 2019 14:42:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728983AbfAVOmq (ORCPT ); Tue, 22 Jan 2019 09:42:46 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37130 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728972AbfAVOmn (ORCPT ); Tue, 22 Jan 2019 09:42:43 -0500 Received: by mail-wr1-f65.google.com with SMTP id s12so27653591wrt.4 for ; Tue, 22 Jan 2019 06:42:41 -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=vsn2lbltQWB983P32jqW91X7YUoIUeTDQZe0mzgn6So=; b=f0ly9B9dzR0uOjnqpnFho+NnlIGLRveEVri+6w0yVi/ha2n9ExAoXnW2vcYpnHbn+f otQXhOavg+0RYDML+iV98M0zMhGpdVhXeiJWZMnsY1m+7W2MlDlMYEqPXPoBNLtXM5N1 cfkEVKC8X4g7EOWhiC6V+y7+W3R6DPR7zfQq7qm/RgZVF98PonVVjTimxtQkxYEjcnol yfgPEMibjwrgs51T/qoK0gQKqmXQOMUZrZeTsGAQK90Sg79be5ZNesDE+6zDYRPokbFk uPwLO481GXpTPu8S+HwDLclr+cviXq9+5p6xvLIFNQjo6OhUHFdnPPqzsM0vKZXSLcic 2Z7w== 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=vsn2lbltQWB983P32jqW91X7YUoIUeTDQZe0mzgn6So=; b=pfNm4jOKYMG1nwctuoNwJld017F0Ww6Fcmg+UjxKBRnO1XfygVtc/lu01lUaHv+b/J 9UrDE62/TNCoohBaWqeO5MawzwgT1hcBq9sLEpp0IldOZFoAvMrcrOYLkA2j3yx6n29R h5JhvFiEL2JqaU+nubx3iXr1Ti2zmOVO73TErwikz+pezfeRxsLtNlZgTeJuQa+BHg7+ XwmcQMNGNYID0wdPFywmHFoeKuffVYKkNn8nF/xeHI3AqV1On//31BIS9qLo/88+RaDL 1gpWn2A333g+sElrn0pdlelvVo2O5BsLzafBDaoGW/71y/IV9pTNnvJtVyYqyDV7xqbP rBNg== X-Gm-Message-State: AJcUukcRxivXASpBzVpX36UrdCIYix2gkKB+ortu0IhtSjjdY9xcS4Va ac+6Y7R6KjoqVdvAPWCJrvpLArlt X-Google-Smtp-Source: ALg8bN6hjZlkxIK51+vuMkZuwrsXgS5aYKgT8co2VbcdG9vMNl1+i43Ihfiywy1hRmmltcDMihdbqw== X-Received: by 2002:adf:f3c6:: with SMTP id g6mr32665162wrp.111.1548168160156; Tue, 22 Jan 2019 06:42:40 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:39 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 12/13] partial-clone: add multiple remotes in the doc Date: Tue, 22 Jan 2019 15:42:11 +0100 Message-Id: <20190122144212.15119-13-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 While at it, let's remove a reference to ODB effort as the ODB effort has been replaced by directly enhancing partial clone and promisor remote features. Signed-off-by: Christian Couder --- Documentation/technical/partial-clone.txt | 83 ++++++++++++++++------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/Documentation/technical/partial-clone.txt b/Documentation/technical/partial-clone.txt index 896c7b3878..58adcc5ce1 100644 --- a/Documentation/technical/partial-clone.txt +++ b/Documentation/technical/partial-clone.txt @@ -100,18 +100,18 @@ or commits that reference missing trees. Handling Missing Objects ------------------------ -- An object may be missing due to a partial clone or fetch, or missing due - to repository corruption. To differentiate these cases, the local - repository specially indicates such filtered packfiles obtained from the - promisor remote as "promisor packfiles". +- An object may be missing due to a partial clone or fetch, or missing + due to repository corruption. To differentiate these cases, the + local repository specially indicates such filtered packfiles + obtained from promisor remotes as "promisor packfiles". + These promisor packfiles consist of a ".promisor" file with arbitrary contents (like the ".keep" files), in addition to their ".pack" and ".idx" files. - The local repository considers a "promisor object" to be an object that - it knows (to the best of its ability) that the promisor remote has promised - that it has, either because the local repository has that object in one of + it knows (to the best of its ability) that promisor remotes have promised + that they have, either because the local repository has that object in one of its promisor packfiles, or because another promisor object refers to it. + When Git encounters a missing object, Git can see if it is a promisor object @@ -123,7 +123,7 @@ expensive-to-modify list of missing objects.[a] - Since almost all Git code currently expects any referenced object to be present locally and because we do not want to force every command to do a dry-run first, a fallback mechanism is added to allow Git to attempt - to dynamically fetch missing objects from the promisor remote. + to dynamically fetch missing objects from promisor remotes. + When the normal object lookup fails to find an object, Git invokes fetch-object to try to get the object from the server and then retry @@ -157,8 +157,7 @@ and prefetch those objects in bulk. + We are not happy with this global variable and would like to remove it, but that requires significant refactoring of the object code to pass an -additional flag. We hope that concurrent efforts to add an ODB API can -encompass this. +additional flag. Fetching Missing Objects @@ -182,21 +181,53 @@ has been updated to not use any object flags when the corresponding argument though they are not necessary. +Using many promisor remotes +--------------------------- + +Many promisor remotes can be configured and used. + +This allows for example a user to have multiple geographically-close +cache servers for fetching missing blobs while continuing to do +filtered `git-fetch` commands from the central server. + +When fetching objects, promisor remotes are tried one after the other +until all the objects have been fetched. + +Remotes that are considered "promisor" remotes are those specified by +the following configuration variables: + +- `extensions.partialClone = ` + +- `remote..promisor = true` + +- `remote..partialCloneFilter = ...` + +Only one promisor remote can be configured using the +`extensions.partialClone` config variable. This promisor remote will +be the last one tried when fetching objects. + +The other promisor remotes will be tried in the order they appear in +the config file. + Current Limitations ------------------- -- The remote used for a partial clone (or the first partial fetch - following a regular clone) is marked as the "promisor remote". +- It is not possible to specify the order in which the promisor + remotes are tried in other ways than the order in which they appear + in the config file. + -We are currently limited to a single promisor remote and only that -remote may be used for subsequent partial fetches. +It is also not possible to specify an order to be used when fetching +from one remote and a different order when fetching from another +remote. + +- It is not possible to push only specific objects to a promisor + remote. + -We accept this limitation because we believe initial users of this -feature will be using it on repositories with a strong single central -server. +It is not possible to push at the same time to multiple promisor +remote in a specific order. -- Dynamic object fetching will only ask the promisor remote for missing - objects. We assume that the promisor remote has a complete view of the +- Dynamic object fetching will only ask promisor remotes for missing + objects. We assume that promisor remotes have a complete view of the repository and can satisfy all such requests. - Repack essentially treats promisor and non-promisor packfiles as 2 @@ -218,15 +249,17 @@ server. Future Work ----------- -- Allow more than one promisor remote and define a strategy for fetching - missing objects from specific promisor remotes or of iterating over the - set of promisor remotes until a missing object is found. +- Improve the way to specify the order in which promisor remotes are + tried. + -A user might want to have multiple geographically-close cache servers -for fetching missing blobs while continuing to do filtered `git-fetch` -commands from the central server, for example. +For example this could allow to specify explicitly something like: +"When fetching from this remote, I want to use these promisor remotes +in this order, though, when pushing or fetching to that remote, I want +to use those promisor remotes in that order." + +- Allow pushing to promisor remotes. + -Or the user might want to work in a triangular work flow with multiple +The user might want to work in a triangular work flow with multiple promisor remotes that each have an incomplete view of the repository. - Allow repack to work on promisor packfiles (while keeping them distinct From patchwork Tue Jan 22 14:42:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10775615 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 A72811399 for ; Tue, 22 Jan 2019 14:42:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9755B2A1F4 for ; Tue, 22 Jan 2019 14:42:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BB3E2AA62; Tue, 22 Jan 2019 14:42:48 +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 2F3DA2A1F4 for ; Tue, 22 Jan 2019 14:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728986AbfAVOmr (ORCPT ); Tue, 22 Jan 2019 09:42:47 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38240 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728973AbfAVOmm (ORCPT ); Tue, 22 Jan 2019 09:42:42 -0500 Received: by mail-wr1-f66.google.com with SMTP id v13so27651829wrw.5 for ; Tue, 22 Jan 2019 06:42:41 -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=rD/75bV/jeg2Muz2AT+6dgGxsd1j/DzJZPKtZtmT2nY=; b=TRwFD3Bbeqp0k2inJjZH55/fmEqHcSZJ3gT5Xq3b08yCf8VYgFAIqhoRcJk04yXFZx 2qbXcmwY1kBGBj3w2YZTe/cX6gV6Y/U4uJaem3Me2wRaKvhOOjSpWUa1FGT7EJWFBu1D Dc6UYKjHNjTS6vVcfhiBrvnZYoWt8+4jlvFkGMWo+acEo8d3dIz5r2St75e4j0BH34+z CshnK3r/3yEtFECeur1MkxZWvsxMrd5ABrGLBKUnAHAE76Rr5K6wIOQhZMNURSzLWeLl utQ77wkJ05XNCbt+5B/P3uWBmL9u88AmjiHWRKtPBc++12mFygrnjCv03k4JxTAKxcjq IC9Q== 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=rD/75bV/jeg2Muz2AT+6dgGxsd1j/DzJZPKtZtmT2nY=; b=AH1F2y0ZNv40PX50eH7/sIyR75zRqWiaA0PBnJJv5fPbxqS6PgCeZ9/YBO2+FElIt8 o7rq0OCRHvZtUmyIN42DTTgZualxZ4gXQ3LbFdQoaxP8Omn5k+cub5trRJX308J+5E0U z78YsYHlE2YaHniuAHQsaJY9VJw3tPC0aPt8534DAmUFBRtDTq0JOIGAlNJlEzvyl0fZ MC9134m/lV/sy/d5iwD5rgI+RcwjsNJAqEydVBvOijuC3dijLCduoygGiH2fHxP3yBS7 mwRm9HM2+4aUQU6NZYz6X++9VxEqoGChsEt/UknczDDQPgx1igaLjRFLGRmlkUcAAnM1 +DqA== X-Gm-Message-State: AJcUuke7u+mJyR0Vy7KUcRvWKOyga9kVpQFgtzk+L7ys0IGaa9NlMZGZ 3Ci+9SsCFK6N9VgQfiVInoAY73li X-Google-Smtp-Source: ALg8bN4RWviVjuBrUBf9eiRfV2hkkPx20pAU4wjNOVE2UeyuQpqDcPVfjNbAP9o7cPgxj0y1Z2QAng== X-Received: by 2002:a5d:4382:: with SMTP id i2mr33000770wrq.172.1548168160861; Tue, 22 Jan 2019 06:42:40 -0800 (PST) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id k26sm31266168wmi.28.2019.01.22.06.42.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 06:42:40 -0800 (PST) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v2 13/13] remote: add promisor and partial clone config to the doc Date: Tue, 22 Jan 2019 15:42:12 +0100 Message-Id: <20190122144212.15119-14-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.20.1.322.gd6b9ae60d4 In-Reply-To: <20190122144212.15119-1-chriscool@tuxfamily.org> References: <20190122144212.15119-1-chriscool@tuxfamily.org> 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 Signed-off-by: Christian Couder --- Documentation/config/remote.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/config/remote.txt b/Documentation/config/remote.txt index 6c4cad83a2..a8e6437a90 100644 --- a/Documentation/config/remote.txt +++ b/Documentation/config/remote.txt @@ -76,3 +76,11 @@ remote..pruneTags:: + See also `remote..prune` and the PRUNING section of linkgit:git-fetch[1]. + +remote..promisor:: + When set to true, this remote will be used to fetch promisor + objects. + +remote..partialclonefilter:: + The filter that will be applied when fetching from this + promisor remote.