From: Ævar Arnfjörð Bjarmason via GitGitGadget Date: Fri, 20 May 2022 18:40:36 GMT Subject: [PATCH 18/24] bundle-uri client: add "git ls-remote-bundle-uri" Message-ID: In-Reply-To: From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= TODO: make this a test-helper instead of its own builtin? 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 Signed-off-by: Derrick Stolee --- .gitignore | 1 + 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 | 71 ++++++++++ command-list.txt | 1 + git.c | 1 + t/lib-t5730-protocol-v2-bundle-uri.sh | 147 ++++++++++++++++++++- transport.c | 43 ++++-- transport.h | 6 +- 12 files changed, 324 insertions(+), 13 deletions(-) create mode 100644 Documentation/git-ls-remote-bundle-uri.txt create mode 100644 builtin/ls-remote-bundle-uri.c diff --git a/.gitignore b/.gitignore index e81de1063a4..e1312b2795c 100644 --- a/.gitignore +++ b/.gitignore @@ -91,6 +91,7 @@ /git-log /git-ls-files /git-ls-remote +/git-ls-remote-bundle-uri /git-ls-tree /git-mailinfo /git-mailsplit 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=]