From patchwork Thu Aug 5 15:07:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12421399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D5F6C4338F for ; Thu, 5 Aug 2021 15:07:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0D2106104F for ; Thu, 5 Aug 2021 15:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241833AbhHEPID (ORCPT ); Thu, 5 Aug 2021 11:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241802AbhHEPH4 (ORCPT ); Thu, 5 Aug 2021 11:07:56 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00116C06179A for ; Thu, 5 Aug 2021 08:07:41 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id c16so6973588wrp.13 for ; Thu, 05 Aug 2021 08:07:41 -0700 (PDT) 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=qBDOnItBFnb7alf2HtrbVDLCOI8LvSqiBHDXY/lTj3w=; b=eHmw4bkRCnRs1ryr0xOA8ONuYRj6ZV51aJwf/+MubLzUZB8+FauVtFZihnYBPXcGpi sdS6PPQK714iVIQbYPdPHZJzUzIG1LiGUzcsBrSG+gc1CihtQA1se6dPfxFhDfinB+P4 HvOhrkmcZzYp6F5Y0YWEGYEGGV/oR32eboT3lsSjPWAfIYGqLIn5hsAAf814cfCKNDev 7iSoOeUVARknJg+dGokqAPu4mE0D9UbJmhU185xmrbKjY8LOkBF7xBjJhFFlYFYfi2Ir e26l339Qd+P8m8JEU2SWz3lyOUjy1rjrh6/psdzk4fFfpTzF0KpZk5bTaahep098EHPj SjCg== 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=qBDOnItBFnb7alf2HtrbVDLCOI8LvSqiBHDXY/lTj3w=; b=Fy2jqWvF+v5aEspmJgO10ha0V6EigtskqBNFU3/jqzaYXnSdgRDDSVaBmYLKS+53YP cltqwt55aa8yxH3MryjcQRsARAnJKFQAKFGqftx8Y5BIyXzkY9A7z1OPmIukoCqTaKK+ BjTK94Wwo1az5EpNPKmtvjTC4WMhG72IorPHUV6eaI7hTfSgmfW+iD+ORQgt2/JcQ19O f84KNb6lub0zxWzKGWT8tvhRYNLW4hGshSnrr76yQc5NsNfP6WAPdCxrcK9hsUX1fHJ8 yvJ3Hvfa1M5NyrTb1zhTA1ikBrHx5ocuoex1tsCLEF+HozPnw1HLXQ8IbqPDprrjSZ9F XbZw== X-Gm-Message-State: AOAM533YMmkFEPjo1jhR3sB8z87WveJnz2A+HbgUCtKT1Sf4SwTAMkYW EPSOhCHKGURICbReL+LXMtqEenmugGqkSg== X-Google-Smtp-Source: ABdhPJwT9aTiB8Kz1wwq/S0H+a4Fps3l0A4oDgclYwOlrh3uR7C+sf/7xNQpy7Q8s9H7ViatY9hQaQ== X-Received: by 2002:a5d:4d0d:: with SMTP id z13mr5688140wrt.34.1628176060233; Thu, 05 Aug 2021 08:07:40 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id w4sm6856340wrm.24.2021.08.05.08.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 08:07:39 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Jeff King , Patrick Steinhardt , Christian Couder , Albert Cui , Jonathan Tan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [RFC PATCH 05/13] bundle-uri client: add "git ls-remote-bundle-uri" Date: Thu, 5 Aug 2021 17:07:21 +0200 Message-Id: X-Mailer: git-send-email 2.33.0.rc0.646.g585563e77f In-Reply-To: References: MIME-Version: 1.0 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 | 63 ++++++++++ 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, 330 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 0000000000..7d3d16a36f --- /dev/null +++ b/Documentation/git-ls-remote-bundle-uri.txt @@ -0,0 +1,63 @@ +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 [--quiet] [--uri] [--upload-pack=] + [[-o | --server-option=]