From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 02CF01F670 for ; Fri, 11 Mar 2022 16:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350283AbiCKQZx (ORCPT ); Fri, 11 Mar 2022 11:25:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350258AbiCKQZr (ORCPT ); Fri, 11 Mar 2022 11:25:47 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A67D210C511 for ; Fri, 11 Mar 2022 08:24:38 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id j17so13796565wrc.0 for ; Fri, 11 Mar 2022 08:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JLd2YVw5tmx/BJCz73mvp3eFaJ4ngzpmjCzNGRitZkw=; b=gUm2ZQQhsM/zYIO3uCjHHXT3DIR+3DmDn6P3H9uYGh56/sLKnuQ5gfkOCTtD4sMcdW Zis040K8EShgGyiuWIFPGp0EvFIxRrgPmD8BuDaZiGNfU/iDk1X1kVgbNBteGPQxs3Vh zlnLg3uH3VtZrSRMxQqzEyhpnuMl9q6m3Bjx4Al/Sl8K3K5LaR4LEYib1nE1aSEmRXGH Kk9YS9kttYzlrSe+KY/mn435JtMzqYvhznqSdgc1UodWAWqEStQR5eRzy+C7HMf2+PT+ 7eUO0KVDD+H/deB4QPbEL+JcHRPufInl+WazMzZQKWomMhsfkL+JJnpqcUE4gYkyMZQt WWpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JLd2YVw5tmx/BJCz73mvp3eFaJ4ngzpmjCzNGRitZkw=; b=Uj4GWVbGX4/cs4IK3qITFGLJZEQeZtdwt+V89ThozVA33jLlWR6hq/asGtEp+XxPzo B2BmbTZo+fzs4Y12JvGZSj2nMBQojVNNCSbmBlP4c3kTgfwXf66GPyt85/rtBOhZ/mH/ dxxRQpzB+z1r4HnoviB3xdHVQ77LG3xAx8KwKgiKNS+Ch1M9OGTfpBrCorY+k8g+VLLY KQSpQiwz+nnu2M/m9FIlLYRpHwUa2qkKmX565cKhceBU2xgxzvIA2cjHebJGy+1ZWKWk pztGPueaPFjZImdIV1rVyByTjVJ1AtpR72sjUZyyesq+PRGnYQCKtyLVgPwuiOaJ03F1 rDIQ== X-Gm-Message-State: AOAM532Qsq+S9AVkcAKzFyhzKrUDgkEmgf+vdJ2NLMf97QmjHvHv1O37 fnz40qqCmtROF6sg+rDt6Of1o3cdPPjL3w== X-Google-Smtp-Source: ABdhPJzy6PAD+9FEeZhhB1m3TpSSi9rqMqadSPSDbY60bgdntf7ESVp/r8wE6LqeBc5tSGvem8wJzA== X-Received: by 2002:adf:dd8e:0:b0:1f0:22f1:aed8 with SMTP id x14-20020adfdd8e000000b001f022f1aed8mr7917776wrl.269.1647015876651; Fri, 11 Mar 2022 08:24:36 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id f22-20020a1cc916000000b00380d3e49e89sm7318667wmb.22.2022.03.11.08.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 08:24:35 -0800 (PST) From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee , Jonathan Tan , Jonathan Nieder , Albert Cui , "Robin H . Johnson" , Teng Long , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [RFC PATCH v2 06/13] bundle-uri client: add "git ls-remote-bundle-uri" Date: Fri, 11 Mar 2022 17:24:18 +0100 Message-Id: X-Mailer: git-send-email 2.35.1.1337.g7e32d794afe In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add a git-ls-remote-bundle-uri command, this is a thin wrapper for issuing protocol v2 "bundle-uri" commands to a server, and to the parsing routines in bundle-uri.c. Since in the "git clone" case we'll have already done the handshake(), but not here, introduce a "got_advertisement" state along with "got_remote_heads". It seems to me that the "got_remote_heads" is badly named in the first place, and the whole logic of eagerly getting ls-refs on handshake() or not could be refactored somewhat, but let's not do that now, and instead just add another self-documenting state variable. Signed-off-by: Ævar Arnfjörð Bjarmason --- Documentation/git-ls-remote-bundle-uri.txt | 62 ++++++++++ Documentation/git-ls-remote.txt | 1 + Makefile | 1 + builtin.h | 1 + builtin/clone.c | 2 +- builtin/ls-remote-bundle-uri.c | 90 ++++++++++++++ command-list.txt | 1 + git.c | 1 + t/lib-t5730-protocol-v2-bundle-uri.sh | 132 +++++++++++++++++++++ transport.c | 43 +++++-- transport.h | 6 +- 11 files changed, 329 insertions(+), 11 deletions(-) create mode 100644 Documentation/git-ls-remote-bundle-uri.txt create mode 100644 builtin/ls-remote-bundle-uri.c diff --git a/Documentation/git-ls-remote-bundle-uri.txt b/Documentation/git-ls-remote-bundle-uri.txt new file mode 100644 index 00000000000..793d7677f2f --- /dev/null +++ b/Documentation/git-ls-remote-bundle-uri.txt @@ -0,0 +1,62 @@ +git-ls-remote-bundle-uri(1) +=========================== + +NAME +---- +git-ls-remote-bundle-uri - List 'bundle-uri' in a remote repository + +SYNOPSIS +-------- +[verse] +'git ls-remote-bundle-uri' [-q |--quiet] [--uri] [--upload-pack=] + [[-o | --server-option=]