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.5 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,RCVD_IN_DNSWL_HI, 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 078711F4D7 for ; Mon, 18 Apr 2022 17:24:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347078AbiDRR1X (ORCPT ); Mon, 18 Apr 2022 13:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347046AbiDRR1G (ORCPT ); Mon, 18 Apr 2022 13:27:06 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AD5933EBD for ; Mon, 18 Apr 2022 10:24:14 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id c10so19324612wrb.1 for ; Mon, 18 Apr 2022 10:24:14 -0700 (PDT) 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=D45sG+hzI4zIoR7FHO+luJjvxLBkny+SPzPP11oYGjA=; b=Bv4Qo1GQN8CsKhp9n1xs2heOu4AYkSXda43ISKPkYrXvW3VaDcyRFLNrld2VqsljOG xhWkpcMZU6AsymuCbC105dm5oG6dKEVko/5jwvSx+juYLPYK1DHpxQHIqbdvtXZX+qOy 8R6jXGBhHvoHdYn/Lxa9Iiv1a0MGiqadFCDGg+YZ7j5rSa6KsupiPa675T2FR1SFrdEy KMDpTvpaWt5r8a+0oQE/HYR/q64NZFwztJFisbowf4NkLPCuk7c5FgvIi3KcNX2ElDOx JKGgdGb/NESe2WV3O15zO6AnQIZ5r6ulSvpflC+MvC7SkmfZHor3QmDfg3LQlbhUYjpm PXuw== 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=D45sG+hzI4zIoR7FHO+luJjvxLBkny+SPzPP11oYGjA=; b=W8/jkaSAYCWPqxXe8WBaNyqvY2rOGlStnoSmU5dZOt/bVD0PR1dPTWn7sgpeynFpcD dvzEMR2eWzQXzrQnRGVHkPxZK+EzccWGd968zxiGU+8RX+W25WnfS6INfAnNC9pkQCG3 sNwZWko78Lnt4LWi9/Y1rMa9gO0BzwNF55kljw51/XopNjDk1IyulMjEAOvZovX7n1Tq Kb6ZJqoZZsPzrU4GsKO6STVC8nFdaKiRDaM/JdrhE9q33t1OQe6mnIok1KU9PCxPTc12 FJ5gJFVfhqoZ3GGHRGtpHpMmLF4wnD1MZ1nH4xJGNzNZ0C92/AJ3R/ViMZikCpNg4KhT 0JYg== X-Gm-Message-State: AOAM533c/Da/ALPVL4EkkDsA2h3LXFOeLzpQ+AE3VZx09BAQwLpAf2Nv Fh5N7vjz511EMHyCk/Dr2nDY8fC0j95avg== X-Google-Smtp-Source: ABdhPJyKOf7w+kWO5+Ye30XmcPIxxa8L0pdeIYuhWjKScTwj54wbtSxeIdXVPV1D3NL/pBn2PyC65A== X-Received: by 2002:a5d:66d0:0:b0:207:a53f:5c2d with SMTP id k16-20020a5d66d0000000b00207a53f5c2dmr8871211wrw.440.1650302652635; Mon, 18 Apr 2022 10:24:12 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id m20-20020a05600c3b1400b0038ebbbb2ad2sm16803066wms.44.2022.04.18.10.24.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Apr 2022 10:24:11 -0700 (PDT) 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 12/36] bundle-uri client: add "git ls-remote-bundle-uri" Date: Mon, 18 Apr 2022 19:23:29 +0200 Message-Id: X-Mailer: git-send-email 2.36.0.rc2.902.g60576bbc845 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 | 124 +++++++++++++++++++++ transport.c | 43 +++++-- transport.h | 6 +- 11 files changed, 321 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=]