git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Brandon Williams <bmwill@google.com>
To: git@vger.kernel.org
Cc: git@jeffhostetler.com, gitster@pobox.com, jrnieder@gmail.com,
	pclouds@gmail.com, peff@peff.net, sbeller@google.com,
	stolee@gmail.com, Brandon Williams <bmwill@google.com>
Subject: [PATCH v4 21/35] fetch-pack: perform a fetch using v2
Date: Wed, 28 Feb 2018 15:22:38 -0800	[thread overview]
Message-ID: <20180228232252.102167-22-bmwill@google.com> (raw)
In-Reply-To: <20180228232252.102167-1-bmwill@google.com>

When communicating with a v2 server, perform a fetch by requesting the
'fetch' command.

Signed-off-by: Brandon Williams <bmwill@google.com>
---
 Documentation/technical/protocol-v2.txt |  68 +++++-
 builtin/fetch-pack.c                    |   2 +-
 fetch-pack.c                            | 270 +++++++++++++++++++++++-
 fetch-pack.h                            |   4 +-
 serve.c                                 |   2 +-
 t/t5701-git-serve.sh                    |   2 +-
 t/t5702-protocol-v2.sh                  |  97 +++++++++
 transport.c                             |   7 +-
 upload-pack.c                           | 141 ++++++++++---
 upload-pack.h                           |   3 +
 10 files changed, 548 insertions(+), 48 deletions(-)

diff --git a/Documentation/technical/protocol-v2.txt b/Documentation/technical/protocol-v2.txt
index 99c70a1e4..0d63456fc 100644
--- a/Documentation/technical/protocol-v2.txt
+++ b/Documentation/technical/protocol-v2.txt
@@ -262,12 +262,43 @@ A `fetch` request can take the following arguments:
 	to its base by position in pack rather than by an oid.  That is,
 	they can read OBJ_OFS_DELTA (ake type 6) in a packfile.
 
+    shallow <oid>
+	A client must notify the server of all commits for which it only
+	has shallow copies (meaning that it doesn't have the parents of
+	a commit) by supplying a 'shallow <oid>' line for each such
+	object so that the server is aware of the limitations of the
+	client's history.  This is so that the server is aware that the
+	client may not have all objects reachable from such commits.
+
+    deepen <depth>
+	Requests that the fetch/clone should be shallow having a commit
+	depth of <depth> relative to the remote side.
+
+    deepen-relative
+	Requests that the semantics of the "deepen" command be changed
+	to indicate that the depth requested is relative to the client's
+	current shallow boundary, instead of relative to the requested
+	commits.
+
+    deepen-since <timestamp>
+	Requests that the shallow clone/fetch should be cut at a
+	specific time, instead of depth.  Internally it's equivalent to
+	doing "git rev-list --max-age=<timestamp>". Cannot be used with
+	"deepen".
+
+    deepen-not <rev>
+	Requests that the shallow clone/fetch should be cut at a
+	specific revision specified by '<rev>', instead of a depth.
+	Internally it's equivalent of doing "git rev-list --not <rev>".
+	Cannot be used with "deepen", but can be used with
+	"deepen-since".
+
 The response of `fetch` is broken into a number of sections separated by
 delimiter packets (0001), with each section beginning with its section
 header.
 
     output = *section
-    section = (acknowledgments | packfile)
+    section = (acknowledgments | shallow-info | packfile)
 	      (flush-pkt | delim-pkt)
 
     acknowledgments = PKT-LINE("acknowledgments" LF)
@@ -277,6 +308,11 @@ header.
     nak = PKT-LINE("NAK" LF)
     ack = PKT-LINE("ACK" SP obj-id LF)
 
+    shallow-info = PKT-LINE("shallow-info" LF)
+		   *PKT-LINE((shallow | unshallow) LF)
+    shallow = "shallow" SP obj-id
+    unshallow = "unshallow" SP obj-id
+
     packfile = PKT-LINE("packfile" LF)
 	       [PACKFILE]
 
@@ -309,6 +345,36 @@ header.
 	  determined the objects it plans to send to the client and no
 	  further negotiation is needed.
 
+----
+    shallow-info section
+	If the client has requested a shallow fetch/clone, a shallow
+	client requests a fetch or the server is shallow then the
+	server's response may include a shallow-info section.  The
+	shallow-info section will be included if (due to one of the
+	above conditions) the server needs to inform the client of any
+	shallow boundaries or adjustments to the clients already
+	existing shallow boundaries.
+
+	* Always begins with the section header "shallow-info"
+
+	* If a positive depth is requested, the server will compute the
+	  set of commits which are no deeper than the desired depth.
+
+	* The server sends a "shallow obj-id" line for each commit whose
+	  parents will not be sent in the following packfile.
+
+	* The server sends an "unshallow obj-id" line for each commit
+	  which the client has indicated is shallow, but is no longer
+	  shallow as a result of the fetch (due to its parents being
+	  sent in the following packfile).
+
+	* The server MUST NOT send any "unshallow" lines for anything
+	  which the client has not indicated was shallow as a part of
+	  its request.
+
+	* This section is only included if a packfile section is also
+	  included in the response.
+
 ----
     packfile section
 	* Always begins with the section header "packfile"
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index b2374ddbb..f9d7d0b5a 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -212,7 +212,7 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
 	}
 
 	ref = fetch_pack(&args, fd, conn, ref, dest, sought, nr_sought,
-			 &shallow, pack_lockfile_ptr);
+			 &shallow, pack_lockfile_ptr, protocol_v0);
 	if (pack_lockfile) {
 		printf("lock %s\n", pack_lockfile);
 		fflush(stdout);
diff --git a/fetch-pack.c b/fetch-pack.c
index 9f6b07ad9..dffcfd66a 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -303,9 +303,9 @@ static void insert_one_alternate_object(struct object *obj)
 #define PIPESAFE_FLUSH 32
 #define LARGE_FLUSH 16384
 
-static int next_flush(struct fetch_pack_args *args, int count)
+static int next_flush(int stateless_rpc, int count)
 {
-	if (args->stateless_rpc) {
+	if (stateless_rpc) {
 		if (count < LARGE_FLUSH)
 			count <<= 1;
 		else
@@ -461,7 +461,7 @@ static int find_common(struct fetch_pack_args *args,
 			send_request(args, fd[1], &req_buf);
 			strbuf_setlen(&req_buf, state_len);
 			flushes++;
-			flush_at = next_flush(args, count);
+			flush_at = next_flush(args->stateless_rpc, count);
 
 			/*
 			 * We keep one window "ahead" of the other side, and
@@ -1008,6 +1008,259 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 	return ref;
 }
 
+static void add_wants(const struct ref *wants, struct strbuf *req_buf)
+{
+	for ( ; wants ; wants = wants->next) {
+		const struct object_id *remote = &wants->old_oid;
+		const char *remote_hex;
+		struct object *o;
+
+		/*
+		 * If that object is complete (i.e. it is an ancestor of a
+		 * local ref), we tell them we have it but do not have to
+		 * tell them about its ancestors, which they already know
+		 * about.
+		 *
+		 * We use lookup_object here because we are only
+		 * interested in the case we *know* the object is
+		 * reachable and we have already scanned it.
+		 */
+		if (((o = lookup_object(remote->hash)) != NULL) &&
+		    (o->flags & COMPLETE)) {
+			continue;
+		}
+
+		remote_hex = oid_to_hex(remote);
+		packet_buf_write(req_buf, "want %s\n", remote_hex);
+	}
+}
+
+static void add_common(struct strbuf *req_buf, struct oidset *common)
+{
+	struct oidset_iter iter;
+	const struct object_id *oid;
+	oidset_iter_init(common, &iter);
+
+	while ((oid = oidset_iter_next(&iter))) {
+		packet_buf_write(req_buf, "have %s\n", oid_to_hex(oid));
+	}
+}
+
+static int add_haves(struct strbuf *req_buf, int *haves_to_send, int *in_vain)
+{
+	int ret = 0;
+	int haves_added = 0;
+	const struct object_id *oid;
+
+	while ((oid = get_rev())) {
+		packet_buf_write(req_buf, "have %s\n", oid_to_hex(oid));
+		if (++haves_added >= *haves_to_send)
+			break;
+	}
+
+	*in_vain += haves_added;
+	if (!haves_added || *in_vain >= MAX_IN_VAIN) {
+		/* Send Done */
+		packet_buf_write(req_buf, "done\n");
+		ret = 1;
+	}
+
+	/* Increase haves to send on next round */
+	*haves_to_send = next_flush(1, *haves_to_send);
+
+	return ret;
+}
+
+static int send_fetch_request(int fd_out, const struct fetch_pack_args *args,
+			      const struct ref *wants, struct oidset *common,
+			      int *haves_to_send, int *in_vain)
+{
+	int ret = 0;
+	struct strbuf req_buf = STRBUF_INIT;
+
+	if (server_supports_v2("fetch", 1))
+		packet_buf_write(&req_buf, "command=fetch");
+	if (server_supports_v2("agent", 0))
+		packet_buf_write(&req_buf, "agent=%s", git_user_agent_sanitized());
+
+	packet_buf_delim(&req_buf);
+	if (args->use_thin_pack)
+		packet_buf_write(&req_buf, "thin-pack");
+	if (args->no_progress)
+		packet_buf_write(&req_buf, "no-progress");
+	if (args->include_tag)
+		packet_buf_write(&req_buf, "include-tag");
+	if (prefer_ofs_delta)
+		packet_buf_write(&req_buf, "ofs-delta");
+
+	/* add wants */
+	add_wants(wants, &req_buf);
+
+	/* Add all of the common commits we've found in previous rounds */
+	add_common(&req_buf, common);
+
+	/* Add initial haves */
+	ret = add_haves(&req_buf, haves_to_send, in_vain);
+
+	/* Send request */
+	packet_buf_flush(&req_buf);
+	write_or_die(fd_out, req_buf.buf, req_buf.len);
+
+	strbuf_release(&req_buf);
+	return ret;
+}
+
+/*
+ * Processes a section header in a server's response and checks if it matches
+ * `section`.  If the value of `peek` is 1, the header line will be peeked (and
+ * not consumed); if 0, the line will be consumed and the function will die if
+ * the section header doesn't match what was expected.
+ */
+static int process_section_header(struct packet_reader *reader,
+				  const char *section, int peek)
+{
+	int ret;
+
+	if (packet_reader_peek(reader) != PACKET_READ_NORMAL)
+		die("error reading packet");
+
+	ret = !strcmp(reader->line, section);
+
+	if (!peek) {
+		if (!ret)
+			die("expected '%s', received '%s'",
+			    section, reader->line);
+		packet_reader_read(reader);
+	}
+
+	return ret;
+}
+
+static int process_acks(struct packet_reader *reader, struct oidset *common)
+{
+	/* received */
+	int received_ready = 0;
+	int received_ack = 0;
+
+	process_section_header(reader, "acknowledgments", 0);
+	while (packet_reader_read(reader) == PACKET_READ_NORMAL) {
+		const char *arg;
+
+		if (!strcmp(reader->line, "NAK"))
+			continue;
+
+		if (skip_prefix(reader->line, "ACK ", &arg)) {
+			struct object_id oid;
+			if (!get_oid_hex(arg, &oid)) {
+				struct commit *commit;
+				oidset_insert(common, &oid);
+				commit = lookup_commit(&oid);
+				mark_common(commit, 0, 1);
+			}
+			continue;
+		}
+
+		if (!strcmp(reader->line, "ready")) {
+			clear_prio_queue(&rev_list);
+			received_ready = 1;
+			continue;
+		}
+
+		die("unexpected acknowledgment line: '%s'", reader->line);
+	}
+
+	if (reader->status != PACKET_READ_FLUSH &&
+	    reader->status != PACKET_READ_DELIM)
+		die("error processing acks: %d", reader->status);
+
+	/* return 0 if no common, 1 if there are common, or 2 if ready */
+	return received_ready ? 2 : (received_ack ? 1 : 0);
+}
+
+enum fetch_state {
+	FETCH_CHECK_LOCAL = 0,
+	FETCH_SEND_REQUEST,
+	FETCH_PROCESS_ACKS,
+	FETCH_GET_PACK,
+	FETCH_DONE,
+};
+
+static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
+				    int fd[2],
+				    const struct ref *orig_ref,
+				    struct ref **sought, int nr_sought,
+				    char **pack_lockfile)
+{
+	struct ref *ref = copy_ref_list(orig_ref);
+	enum fetch_state state = FETCH_CHECK_LOCAL;
+	struct oidset common = OIDSET_INIT;
+	struct packet_reader reader;
+	int in_vain = 0;
+	int haves_to_send = INITIAL_FLUSH;
+	packet_reader_init(&reader, fd[0], NULL, 0,
+			   PACKET_READ_CHOMP_NEWLINE);
+
+	while (state != FETCH_DONE) {
+		switch (state) {
+		case FETCH_CHECK_LOCAL:
+			sort_ref_list(&ref, ref_compare_name);
+			QSORT(sought, nr_sought, cmp_ref_by_name);
+
+			/* v2 supports these by default */
+			allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1;
+			use_sideband = 2;
+
+			if (marked)
+				for_each_ref(clear_marks, NULL);
+			marked = 1;
+
+			for_each_ref(rev_list_insert_ref_oid, NULL);
+			for_each_cached_alternate(insert_one_alternate_object);
+
+			/* Filter 'ref' by 'sought' and those that aren't local */
+			if (everything_local(args, &ref, sought, nr_sought))
+				state = FETCH_DONE;
+			else
+				state = FETCH_SEND_REQUEST;
+			break;
+		case FETCH_SEND_REQUEST:
+			if (send_fetch_request(fd[1], args, ref, &common,
+					       &haves_to_send, &in_vain))
+				state = FETCH_GET_PACK;
+			else
+				state = FETCH_PROCESS_ACKS;
+			break;
+		case FETCH_PROCESS_ACKS:
+			/* Process ACKs/NAKs */
+			switch (process_acks(&reader, &common)) {
+			case 2:
+				state = FETCH_GET_PACK;
+				break;
+			case 1:
+				in_vain = 0;
+				/* fallthrough */
+			default:
+				state = FETCH_SEND_REQUEST;
+				break;
+			}
+			break;
+		case FETCH_GET_PACK:
+			/* get the pack */
+			process_section_header(&reader, "packfile", 0);
+			if (get_pack(args, fd, pack_lockfile))
+				die(_("git fetch-pack: fetch failed."));
+
+			state = FETCH_DONE;
+			break;
+		case FETCH_DONE:
+			continue;
+		}
+	}
+
+	oidset_clear(&common);
+	return ref;
+}
+
 static void fetch_pack_config(void)
 {
 	git_config_get_int("fetch.unpacklimit", &fetch_unpack_limit);
@@ -1153,7 +1406,8 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
 		       const char *dest,
 		       struct ref **sought, int nr_sought,
 		       struct oid_array *shallow,
-		       char **pack_lockfile)
+		       char **pack_lockfile,
+		       enum protocol_version version)
 {
 	struct ref *ref_cpy;
 	struct shallow_info si;
@@ -1167,8 +1421,12 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
 		die(_("no matching remote head"));
 	}
 	prepare_shallow_info(&si, shallow);
-	ref_cpy = do_fetch_pack(args, fd, ref, sought, nr_sought,
-				&si, pack_lockfile);
+	if (version == protocol_v2)
+		ref_cpy = do_fetch_pack_v2(args, fd, ref, sought, nr_sought,
+					   pack_lockfile);
+	else
+		ref_cpy = do_fetch_pack(args, fd, ref, sought, nr_sought,
+					&si, pack_lockfile);
 	reprepare_packed_git();
 	update_shallow(args, sought, nr_sought, &si);
 	clear_shallow_info(&si);
diff --git a/fetch-pack.h b/fetch-pack.h
index b6aeb43a8..7afca7305 100644
--- a/fetch-pack.h
+++ b/fetch-pack.h
@@ -3,6 +3,7 @@
 
 #include "string-list.h"
 #include "run-command.h"
+#include "protocol.h"
 
 struct oid_array;
 
@@ -43,7 +44,8 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
 		       struct ref **sought,
 		       int nr_sought,
 		       struct oid_array *shallow,
-		       char **pack_lockfile);
+		       char **pack_lockfile,
+		       enum protocol_version version);
 
 /*
  * Print an appropriate error message for each sought ref that wasn't
diff --git a/serve.c b/serve.c
index 05cc434cf..c3e58c1e7 100644
--- a/serve.c
+++ b/serve.c
@@ -53,7 +53,7 @@ struct protocol_capability {
 static struct protocol_capability capabilities[] = {
 	{ "agent", agent_advertise, NULL },
 	{ "ls-refs", always_advertise, ls_refs },
-	{ "fetch", always_advertise, upload_pack_v2 },
+	{ "fetch", upload_pack_advertise, upload_pack_v2 },
 };
 
 static void advertise_capabilities(void)
diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
index cc5918a67..569922f7a 100755
--- a/t/t5701-git-serve.sh
+++ b/t/t5701-git-serve.sh
@@ -9,7 +9,7 @@ test_expect_success 'test capability advertisement' '
 	version 2
 	agent=git/$(git version | cut -d" " -f3)
 	ls-refs
-	fetch
+	fetch=shallow
 	0000
 	EOF
 
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 562610fd2..4365ac273 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -45,6 +45,56 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
 	test_cmp actual expect
 '
 
+test_expect_success 'clone with git:// using protocol v2' '
+	test_when_finished "rm -f log" &&
+
+	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
+		clone "$GIT_DAEMON_URL/parent" daemon_child &&
+
+	git -C daemon_child log -1 --format=%s >actual &&
+	git -C "$daemon_parent" log -1 --format=%s >expect &&
+	test_cmp expect actual &&
+
+	# Client requested to use protocol v2
+	grep "clone> .*\\\0\\\0version=2\\\0$" log &&
+	# Server responded using protocol v2
+	grep "clone< version 2" log
+'
+
+test_expect_success 'fetch with git:// using protocol v2' '
+	test_when_finished "rm -f log" &&
+
+	test_commit -C "$daemon_parent" two &&
+
+	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
+		fetch &&
+
+	git -C daemon_child log -1 --format=%s origin/master >actual &&
+	git -C "$daemon_parent" log -1 --format=%s >expect &&
+	test_cmp expect actual &&
+
+	# Client requested to use protocol v2
+	grep "fetch> .*\\\0\\\0version=2\\\0$" log &&
+	# Server responded using protocol v2
+	grep "fetch< version 2" log
+'
+
+test_expect_success 'pull with git:// using protocol v2' '
+	test_when_finished "rm -f log" &&
+
+	GIT_TRACE_PACKET="$(pwd)/log" git -C daemon_child -c protocol.version=2 \
+		pull &&
+
+	git -C daemon_child log -1 --format=%s >actual &&
+	git -C "$daemon_parent" log -1 --format=%s >expect &&
+	test_cmp expect actual &&
+
+	# Client requested to use protocol v2
+	grep "fetch> .*\\\0\\\0version=2\\\0$" log &&
+	# Server responded using protocol v2
+	grep "fetch< version 2" log
+'
+
 stop_git_daemon
 
 # Test protocol v2 with 'file://' transport
@@ -80,4 +130,51 @@ test_expect_success 'ref advertisment is filtered with ls-remote using protocol
 	test_cmp actual expect
 '
 
+test_expect_success 'clone with file:// using protocol v2' '
+	test_when_finished "rm -f log" &&
+
+	GIT_TRACE_PACKET="$(pwd)/log" git -c protocol.version=2 \
+		clone "file://$(pwd)/file_parent" file_child &&
+
+	git -C file_child log -1 --format=%s >actual &&
+	git -C file_parent log -1 --format=%s >expect &&
+	test_cmp expect actual &&
+
+	# Server responded using protocol v2
+	grep "clone< version 2" log
+'
+
+test_expect_success 'fetch with file:// using protocol v2' '
+	test_when_finished "rm -f log" &&
+
+	test_commit -C file_parent two &&
+
+	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
+		fetch origin &&
+
+	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_parent log -1 --format=%s >expect &&
+	test_cmp expect actual &&
+
+	# Server responded using protocol v2
+	grep "fetch< version 2" log
+'
+
+test_expect_success 'ref advertisment is filtered during fetch using protocol v2' '
+	test_when_finished "rm -f log" &&
+
+	test_commit -C file_parent three &&
+
+	GIT_TRACE_PACKET="$(pwd)/log" git -C file_child -c protocol.version=2 \
+		fetch origin master &&
+
+	git -C file_child log -1 --format=%s origin/master >actual &&
+	git -C file_parent log -1 --format=%s >expect &&
+	test_cmp expect actual &&
+
+	! grep "refs/tags/one" log &&
+	! grep "refs/tags/two" log &&
+	! grep "refs/tags/three" log
+'
+
 test_done
diff --git a/transport.c b/transport.c
index bf7ba6879..8e38352c5 100644
--- a/transport.c
+++ b/transport.c
@@ -256,14 +256,17 @@ static int fetch_refs_via_pack(struct transport *transport,
 
 	switch (data->version) {
 	case protocol_v2:
-		die("support for protocol v2 not implemented yet");
+		refs = fetch_pack(&args, data->fd, data->conn,
+				  refs_tmp ? refs_tmp : transport->remote_refs,
+				  dest, to_fetch, nr_heads, &data->shallow,
+				  &transport->pack_lockfile, data->version);
 		break;
 	case protocol_v1:
 	case protocol_v0:
 		refs = fetch_pack(&args, data->fd, data->conn,
 				  refs_tmp ? refs_tmp : transport->remote_refs,
 				  dest, to_fetch, nr_heads, &data->shallow,
-				  &transport->pack_lockfile);
+				  &transport->pack_lockfile, data->version);
 		break;
 	case protocol_unknown_version:
 		BUG("unknown protocol version");
diff --git a/upload-pack.c b/upload-pack.c
index 2af6b1382..65a1beeb0 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -710,7 +710,6 @@ static void deepen(int depth, int deepen_relative,
 	}
 
 	send_unshallow(shallows);
-	packet_flush(1);
 }
 
 static void deepen_by_rev_list(int ac, const char **av,
@@ -722,7 +721,53 @@ static void deepen_by_rev_list(int ac, const char **av,
 	send_shallow(result);
 	free_commit_list(result);
 	send_unshallow(shallows);
-	packet_flush(1);
+}
+
+/* Returns 1 if a shallow list is sent or 0 otherwise */
+static int send_shallow_list(int depth, int deepen_rev_list,
+			     timestamp_t deepen_since,
+			     struct string_list *deepen_not,
+			     struct object_array *shallows)
+{
+	int ret = 0;
+
+	if (depth > 0 && deepen_rev_list)
+		die("git upload-pack: deepen and deepen-since (or deepen-not) cannot be used together");
+	if (depth > 0) {
+		deepen(depth, deepen_relative, shallows);
+		ret = 1;
+	} else if (deepen_rev_list) {
+		struct argv_array av = ARGV_ARRAY_INIT;
+		int i;
+
+		argv_array_push(&av, "rev-list");
+		if (deepen_since)
+			argv_array_pushf(&av, "--max-age=%"PRItime, deepen_since);
+		if (deepen_not->nr) {
+			argv_array_push(&av, "--not");
+			for (i = 0; i < deepen_not->nr; i++) {
+				struct string_list_item *s = deepen_not->items + i;
+				argv_array_push(&av, s->string);
+			}
+			argv_array_push(&av, "--not");
+		}
+		for (i = 0; i < want_obj.nr; i++) {
+			struct object *o = want_obj.objects[i].item;
+			argv_array_push(&av, oid_to_hex(&o->oid));
+		}
+		deepen_by_rev_list(av.argc, av.argv, shallows);
+		argv_array_clear(&av);
+		ret = 1;
+	} else {
+		if (shallows->nr > 0) {
+			int i;
+			for (i = 0; i < shallows->nr; i++)
+				register_shallow(&shallows->objects[i].item->oid);
+		}
+	}
+
+	shallow_nr += shallows->nr;
+	return ret;
 }
 
 static int process_shallow(const char *line, struct object_array *shallows)
@@ -884,40 +929,10 @@ static void receive_needs(void)
 
 	if (depth == 0 && !deepen_rev_list && shallows.nr == 0)
 		return;
-	if (depth > 0 && deepen_rev_list)
-		die("git upload-pack: deepen and deepen-since (or deepen-not) cannot be used together");
-	if (depth > 0)
-		deepen(depth, deepen_relative, &shallows);
-	else if (deepen_rev_list) {
-		struct argv_array av = ARGV_ARRAY_INIT;
-		int i;
 
-		argv_array_push(&av, "rev-list");
-		if (deepen_since)
-			argv_array_pushf(&av, "--max-age=%"PRItime, deepen_since);
-		if (deepen_not.nr) {
-			argv_array_push(&av, "--not");
-			for (i = 0; i < deepen_not.nr; i++) {
-				struct string_list_item *s = deepen_not.items + i;
-				argv_array_push(&av, s->string);
-			}
-			argv_array_push(&av, "--not");
-		}
-		for (i = 0; i < want_obj.nr; i++) {
-			struct object *o = want_obj.objects[i].item;
-			argv_array_push(&av, oid_to_hex(&o->oid));
-		}
-		deepen_by_rev_list(av.argc, av.argv, &shallows);
-		argv_array_clear(&av);
-	}
-	else
-		if (shallows.nr > 0) {
-			int i;
-			for (i = 0; i < shallows.nr; i++)
-				register_shallow(&shallows.objects[i].item->oid);
-		}
-
-	shallow_nr += shallows.nr;
+	if (send_shallow_list(depth, deepen_rev_list, deepen_since,
+			      &deepen_not, &shallows))
+		packet_flush(1);
 	object_array_clear(&shallows);
 }
 
@@ -1071,6 +1086,13 @@ struct upload_pack_data {
 	struct object_array wants;
 	struct oid_array haves;
 
+	struct object_array shallows;
+	struct string_list deepen_not;
+	int depth;
+	timestamp_t deepen_since;
+	int deepen_rev_list;
+	int deepen_relative;
+
 	unsigned stateless_rpc : 1;
 
 	unsigned use_thin_pack : 1;
@@ -1084,16 +1106,22 @@ static void upload_pack_data_init(struct upload_pack_data *data)
 {
 	struct object_array wants = OBJECT_ARRAY_INIT;
 	struct oid_array haves = OID_ARRAY_INIT;
+	struct object_array shallows = OBJECT_ARRAY_INIT;
+	struct string_list deepen_not = STRING_LIST_INIT_DUP;
 
 	memset(data, 0, sizeof(*data));
 	data->wants = wants;
 	data->haves = haves;
+	data->shallows = shallows;
+	data->deepen_not = deepen_not;
 }
 
 static void upload_pack_data_clear(struct upload_pack_data *data)
 {
 	object_array_clear(&data->wants);
 	oid_array_clear(&data->haves);
+	object_array_clear(&data->shallows);
+	string_list_clear(&data->deepen_not, 0);
 }
 
 static int parse_want(const char *line)
@@ -1178,6 +1206,22 @@ static void process_args(struct argv_array *args, struct upload_pack_data *data)
 			continue;
 		}
 
+		/* Shallow related arguments */
+		if (process_shallow(arg, &data->shallows))
+			continue;
+		if (process_deepen(arg, &data->depth))
+			continue;
+		if (process_deepen_since(arg, &data->deepen_since,
+					 &data->deepen_rev_list))
+			continue;
+		if (process_deepen_not(arg, &data->deepen_not,
+				       &data->deepen_rev_list))
+			continue;
+		if (!strcmp(arg, "deepen-relative")) {
+			data->deepen_relative = 1;
+			continue;
+		}
+
 		/* ignore unknown lines maybe? */
 		die("unexpect line: '%s'", arg);
 	}
@@ -1273,6 +1317,23 @@ static int process_haves_and_send_acks(struct upload_pack_data *data)
 	return ret;
 }
 
+static void send_shallow_info(struct upload_pack_data *data)
+{
+	/* No shallow info needs to be sent */
+	if (!data->depth && !data->deepen_rev_list && !data->shallows.nr &&
+	    !is_repository_shallow())
+		return;
+
+	packet_write_fmt(1, "shallow-info\n");
+
+	if (!send_shallow_list(data->depth, data->deepen_rev_list,
+			       data->deepen_since, &data->deepen_not,
+			       &data->shallows) && is_repository_shallow())
+		deepen(INFINITE_DEPTH, data->deepen_relative, &data->shallows);
+
+	packet_delim(1);
+}
+
 enum fetch_state {
 	FETCH_PROCESS_ARGS = 0,
 	FETCH_SEND_ACKS,
@@ -1320,6 +1381,8 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
 				state = FETCH_DONE;
 			break;
 		case FETCH_SEND_PACK:
+			send_shallow_info(&data);
+
 			packet_write_fmt(1, "packfile\n");
 			create_pack_file();
 			state = FETCH_DONE;
@@ -1332,3 +1395,11 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
 	upload_pack_data_clear(&data);
 	return 0;
 }
+
+int upload_pack_advertise(struct repository *r,
+			  struct strbuf *value)
+{
+	if (value)
+		strbuf_addstr(value, "shallow");
+	return 1;
+}
diff --git a/upload-pack.h b/upload-pack.h
index 6b7890238..7720f2142 100644
--- a/upload-pack.h
+++ b/upload-pack.h
@@ -14,5 +14,8 @@ struct repository;
 struct argv_array;
 extern int upload_pack_v2(struct repository *r, struct argv_array *keys,
 			  struct argv_array *args);
+struct strbuf;
+extern int upload_pack_advertise(struct repository *r,
+				 struct strbuf *value);
 
 #endif /* UPLOAD_PACK_H */
-- 
2.16.2.395.g2e18187dfd-goog


  parent reply	other threads:[~2018-02-28 23:24 UTC|newest]

Thread overview: 362+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03  0:18 [PATCH 00/26] protocol version 2 Brandon Williams
2018-01-03  0:18 ` [PATCH 01/26] pkt-line: introduce packet_read_with_status Brandon Williams
2018-01-03 19:27   ` Stefan Beller
2018-01-05 23:41     ` Brandon Williams
2018-01-09 18:04   ` Jonathan Tan
2018-01-09 19:28     ` Brandon Williams
2018-01-03  0:18 ` [PATCH 02/26] pkt-line: introduce struct packet_reader Brandon Williams
2018-01-09 18:08   ` Jonathan Tan
2018-01-09 19:19     ` Brandon Williams
2018-01-03  0:18 ` [PATCH 03/26] pkt-line: add delim packet support Brandon Williams
2018-01-03  0:18 ` [PATCH 04/26] upload-pack: convert to a builtin Brandon Williams
2018-01-03 20:33   ` Stefan Beller
2018-01-03 20:39     ` Brandon Williams
2018-02-21 21:47       ` Jonathan Nieder
2018-02-21 23:35         ` Junio C Hamano
2018-01-03  0:18 ` [PATCH 05/26] upload-pack: factor out processing lines Brandon Williams
2018-01-03 20:38   ` Stefan Beller
2018-01-03  0:18 ` [PATCH 06/26] transport: use get_refs_via_connect to get refs Brandon Williams
2018-01-03 21:20   ` Stefan Beller
2018-01-03  0:18 ` [PATCH 07/26] connect: convert get_remote_heads to use struct packet_reader Brandon Williams
2018-01-09 18:27   ` Jonathan Tan
2018-01-09 19:09     ` Brandon Williams
2018-01-03  0:18 ` [PATCH 08/26] connect: discover protocol version outside of get_remote_heads Brandon Williams
2018-01-03  0:18 ` [PATCH 09/26] transport: store protocol version Brandon Williams
2018-01-09 18:41   ` Jonathan Tan
2018-01-09 19:15     ` Brandon Williams
2018-01-03  0:18 ` [PATCH 10/26] protocol: introduce enum protocol_version value protocol_v2 Brandon Williams
2018-01-03  0:18 ` [PATCH 11/26] serve: introduce git-serve Brandon Williams
2018-01-09 20:24   ` Jonathan Tan
2018-01-09 22:16     ` Brandon Williams
2018-01-09 22:28       ` Jonathan Tan
2018-01-09 22:34         ` Brandon Williams
2018-02-01 18:48   ` Jeff Hostetler
2018-02-01 18:57     ` Stefan Beller
2018-02-01 19:09       ` Jeff Hostetler
2018-02-01 20:05         ` Brandon Williams
2018-02-01 19:45       ` Randall S. Becker
2018-02-01 20:08         ` 'Brandon Williams'
2018-02-01 20:37           ` Randall S. Becker
2018-02-01 20:50             ` Stefan Beller
2018-01-03  0:18 ` [PATCH 12/26] ls-refs: introduce ls-refs server command Brandon Williams
2018-01-04  0:17   ` Stefan Beller
2018-01-05 23:49     ` Brandon Williams
2018-01-09 20:50   ` Jonathan Tan
2018-01-16 19:23     ` Brandon Williams
2018-02-01 19:16   ` Jeff Hostetler
2018-02-07  0:55     ` Brandon Williams
2018-01-03  0:18 ` [PATCH 13/26] connect: request remote refs using v2 Brandon Williams
2018-01-09 22:24   ` Jonathan Tan
2018-01-03  0:18 ` [PATCH 14/26] transport: convert get_refs_list to take a list of ref patterns Brandon Williams
2018-01-03  0:18 ` [PATCH 15/26] transport: convert transport_get_remote_refs " Brandon Williams
2018-01-03  0:18 ` [PATCH 16/26] ls-remote: pass ref patterns when requesting a remote's refs Brandon Williams
2018-01-03  0:18 ` [PATCH 17/26] fetch: pass ref patterns when fetching Brandon Williams
2018-01-03  0:18 ` [PATCH 18/26] push: pass ref patterns when pushing Brandon Williams
2018-01-03  0:18 ` [PATCH 19/26] upload-pack: introduce fetch server command Brandon Williams
2018-01-04  1:07   ` Stefan Beller
2018-01-03  0:18 ` [PATCH 20/26] fetch-pack: perform a fetch using v2 Brandon Williams
2018-01-04  1:23   ` Stefan Beller
2018-01-05 23:55     ` Brandon Williams
2018-01-10  0:05   ` Jonathan Tan
2018-01-03  0:18 ` [PATCH 21/26] transport-helper: remove name parameter Brandon Williams
2018-01-03  0:18 ` [PATCH 22/26] transport-helper: refactor process_connect_service Brandon Williams
2018-01-03  0:18 ` [PATCH 23/26] transport-helper: introduce connect-half-duplex Brandon Williams
2018-01-03  0:18 ` [PATCH 24/26] pkt-line: add packet_buf_write_len function Brandon Williams
2018-01-03  0:18 ` [PATCH 25/26] remote-curl: create copy of the service name Brandon Williams
2018-01-03  0:18 ` [PATCH 26/26] remote-curl: implement connect-half-duplex command Brandon Williams
2018-01-10  0:10   ` Jonathan Tan
2018-01-10 17:57   ` Jonathan Tan
2018-01-11  1:09     ` Brandon Williams
2018-01-09 17:55 ` [PATCH 00/26] protocol version 2 Jonathan Tan
2018-01-11  0:23   ` Brandon Williams
2018-01-25 23:58 ` [PATCH v2 00/27] " Brandon Williams
2018-01-25 23:58   ` [PATCH v2 01/27] pkt-line: introduce packet_read_with_status Brandon Williams
2018-01-25 23:58   ` [PATCH v2 02/27] pkt-line: introduce struct packet_reader Brandon Williams
2018-01-25 23:58   ` [PATCH v2 03/27] pkt-line: add delim packet support Brandon Williams
2018-01-25 23:58   ` [PATCH v2 04/27] upload-pack: convert to a builtin Brandon Williams
2018-01-25 23:58   ` [PATCH v2 05/27] upload-pack: factor out processing lines Brandon Williams
2018-01-26 20:12     ` Stefan Beller
2018-01-26 21:33       ` Brandon Williams
2018-01-31 14:08         ` Derrick Stolee
2018-01-25 23:58   ` [PATCH v2 06/27] transport: use get_refs_via_connect to get refs Brandon Williams
2018-01-25 23:58   ` [PATCH v2 07/27] connect: convert get_remote_heads to use struct packet_reader Brandon Williams
2018-01-25 23:58   ` [PATCH v2 08/27] connect: discover protocol version outside of get_remote_heads Brandon Williams
2018-01-31 14:40     ` Derrick Stolee
2018-02-01 17:57       ` Brandon Williams
2018-01-25 23:58   ` [PATCH v2 09/27] transport: store protocol version Brandon Williams
2018-01-31 14:45     ` Derrick Stolee
2018-01-25 23:58   ` [PATCH v2 10/27] protocol: introduce enum protocol_version value protocol_v2 Brandon Williams
2018-01-31 14:54     ` Derrick Stolee
2018-02-02 22:44       ` Brandon Williams
2018-02-05 14:14         ` Derrick Stolee
2018-01-25 23:58   ` [PATCH v2 11/27] test-pkt-line: introduce a packet-line test helper Brandon Williams
2018-01-25 23:58   ` [PATCH v2 12/27] serve: introduce git-serve Brandon Williams
2018-01-26 10:39     ` Duy Nguyen
2018-02-27  5:46       ` Jonathan Nieder
2018-01-31 15:39     ` Derrick Stolee
2018-01-25 23:58   ` [PATCH v2 13/27] ls-refs: introduce ls-refs server command Brandon Williams
2018-01-26 22:20     ` Stefan Beller
2018-02-02 22:31       ` Brandon Williams
2018-01-25 23:58   ` [PATCH v2 14/27] connect: request remote refs using v2 Brandon Williams
2018-01-31 15:22     ` Derrick Stolee
2018-01-31 20:10       ` Eric Sunshine
2018-01-31 22:14         ` Derrick Stolee
2018-01-25 23:58   ` [PATCH v2 15/27] transport: convert get_refs_list to take a list of ref patterns Brandon Williams
2018-01-25 23:58   ` [PATCH v2 16/27] transport: convert transport_get_remote_refs " Brandon Williams
2018-01-25 23:58   ` [PATCH v2 17/27] ls-remote: pass ref patterns when requesting a remote's refs Brandon Williams
2018-01-25 23:58   ` [PATCH v2 18/27] fetch: pass ref patterns when fetching Brandon Williams
2018-01-25 23:58   ` [PATCH v2 19/27] push: pass ref patterns when pushing Brandon Williams
2018-01-25 23:58   ` [PATCH v2 20/27] upload-pack: introduce fetch server command Brandon Williams
2018-01-25 23:58   ` [PATCH v2 21/27] fetch-pack: perform a fetch using v2 Brandon Williams
2018-01-25 23:58   ` [PATCH v2 22/27] transport-helper: remove name parameter Brandon Williams
2018-01-25 23:58   ` [PATCH v2 23/27] transport-helper: refactor process_connect_service Brandon Williams
2018-01-25 23:58   ` [PATCH v2 24/27] transport-helper: introduce stateless-connect Brandon Williams
2018-01-25 23:58   ` [PATCH v2 25/27] pkt-line: add packet_buf_write_len function Brandon Williams
2018-01-25 23:58   ` [PATCH v2 26/27] remote-curl: create copy of the service name Brandon Williams
2018-01-25 23:58   ` [PATCH v2 27/27] remote-curl: implement stateless-connect command Brandon Williams
2018-01-31 16:00   ` [PATCH v2 00/27] protocol version 2 Derrick Stolee
2018-02-07  0:58     ` Brandon Williams
2018-02-01 19:40   ` Jeff Hostetler
2018-02-07  1:12   ` [PATCH v3 00/35] " Brandon Williams
2018-02-07  1:12     ` [PATCH v3 01/35] pkt-line: introduce packet_read_with_status Brandon Williams
2018-02-13  0:25       ` Jonathan Nieder
2018-02-07  1:12     ` [PATCH v3 02/35] pkt-line: introduce struct packet_reader Brandon Williams
2018-02-13  0:49       ` Jonathan Nieder
2018-02-27 18:14         ` Brandon Williams
2018-02-27 19:20           ` Jonathan Nieder
2018-02-27  5:57       ` Jonathan Nieder
2018-02-27  6:12         ` Jonathan Nieder
2018-02-07  1:12     ` [PATCH v3 03/35] pkt-line: add delim packet support Brandon Williams
2018-02-22 19:13       ` Stefan Beller
2018-02-22 19:37         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 04/35] upload-pack: convert to a builtin Brandon Williams
2018-02-21 21:44       ` Jonathan Tan
2018-02-22  9:58         ` Jeff King
2018-02-22 18:07           ` Brandon Williams
2018-02-22 18:14             ` Jeff King
2018-02-22 19:38               ` Jonathan Nieder
2018-02-22 20:19                 ` Jeff King
2018-02-22 20:21                   ` Jeff King
2018-02-22 21:26                     ` Jonathan Nieder
2018-02-22 21:44                       ` Jeff King
2018-03-12 22:43                         ` Jonathan Nieder
2018-03-12 23:28                           ` Jeff King
2018-03-12 23:37                             ` Jonathan Nieder
2018-03-12 23:52                               ` Jeff King
2018-02-23 21:09                     ` Brandon Williams
2018-03-03  4:24                       ` Jeff King
2018-02-22 21:24                   ` Jonathan Nieder
2018-02-22 21:44                     ` Jeff King
2018-02-22 22:21                       ` Jeff King
2018-02-22 22:42                         ` Jonathan Nieder
2018-02-22 23:05                           ` Jeff King
2018-02-22 23:23                             ` Jeff King
2018-02-07  1:12     ` [PATCH v3 05/35] upload-pack: factor out processing lines Brandon Williams
2018-02-22 19:31       ` Stefan Beller
2018-02-22 19:39         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 06/35] transport: use get_refs_via_connect to get refs Brandon Williams
2018-02-27  6:08       ` Jonathan Nieder
2018-02-27 18:17         ` Brandon Williams
2018-02-27 19:25           ` Jonathan Nieder
2018-02-27 19:46             ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 07/35] connect: convert get_remote_heads to use struct packet_reader Brandon Williams
2018-02-22 19:52       ` Stefan Beller
2018-02-22 20:09       ` Stefan Beller
2018-02-23 21:30         ` Brandon Williams
2018-02-23 21:48           ` Stefan Beller
2018-02-23 22:56             ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 08/35] connect: discover protocol version outside of get_remote_heads Brandon Williams
2018-02-21 22:11       ` Jonathan Tan
2018-02-22 18:17         ` Brandon Williams
2018-02-22 19:22           ` Jonathan Tan
2018-02-07  1:12     ` [PATCH v3 09/35] transport: store protocol version Brandon Williams
2018-02-07  1:12     ` [PATCH v3 10/35] protocol: introduce enum protocol_version value protocol_v2 Brandon Williams
2018-02-27  6:18       ` Jonathan Nieder
2018-02-27 18:41         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 11/35] test-pkt-line: introduce a packet-line test helper Brandon Williams
2018-02-22 20:40       ` Stefan Beller
2018-02-23 21:22         ` Brandon Williams
2018-03-03  4:25           ` Jeff King
2018-03-05 18:48             ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 12/35] serve: introduce git-serve Brandon Williams
2018-02-21 22:45       ` Jonathan Tan
2018-02-23 21:33         ` Brandon Williams
2018-02-27 18:05           ` Jonathan Tan
2018-02-27 18:34             ` Brandon Williams
2018-02-22  9:33       ` Jeff King
2018-02-23 21:45         ` Brandon Williams
2018-03-03  4:33           ` Jeff King
2018-03-05 18:43             ` Brandon Williams
2018-03-05 20:52               ` Jeff King
2018-03-05 21:36                 ` Jonathan Nieder
2018-03-06  6:29                   ` Jeff King
2018-03-12 23:46                     ` Jeff King
2018-02-07  1:12     ` [PATCH v3 13/35] ls-refs: introduce ls-refs server command Brandon Williams
2018-02-22  9:48       ` Jeff King
2018-02-23  0:45         ` Brandon Williams
2018-02-24  0:19           ` Brandon Williams
2018-02-24  4:03             ` Jeff King
2018-02-24  4:01           ` Jeff King
2018-02-26 22:33             ` Junio C Hamano
2018-02-27  0:02             ` Ævar Arnfjörð Bjarmason
2018-02-27  5:15               ` Jonathan Nieder
2018-02-27 18:02                 ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 14/35] connect: request remote refs using v2 Brandon Williams
2018-02-21 22:54       ` Jonathan Tan
2018-02-22 18:19         ` Brandon Williams
2018-02-22 18:26           ` Jeff King
2018-02-22 19:25             ` Jonathan Tan
2018-02-27  6:21               ` Jonathan Nieder
2018-02-27 21:58                 ` Junio C Hamano
2018-02-27 22:04                   ` Jeff King
2018-02-27 22:10                     ` Eric Sunshine
2018-02-27 22:18                       ` Jeff King
2018-02-27 23:32                         ` Junio C Hamano
2018-02-27  6:51       ` Jonathan Nieder
2018-02-27 19:30         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 15/35] transport: convert get_refs_list to take a list of ref patterns Brandon Williams
2018-02-21 22:56       ` Jonathan Tan
2018-02-22 18:25         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 16/35] transport: convert transport_get_remote_refs " Brandon Williams
2018-02-21 22:58       ` Jonathan Tan
2018-02-22 18:26         ` Brandon Williams
2018-02-22 19:32           ` Jonathan Tan
2018-02-22 19:51             ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 17/35] ls-remote: pass ref patterns when requesting a remote's refs Brandon Williams
2018-02-07  1:12     ` [PATCH v3 18/35] fetch: pass ref patterns when fetching Brandon Williams
2018-02-27  6:53       ` Jonathan Nieder
2018-02-07  1:12     ` [PATCH v3 19/35] push: pass ref patterns when pushing Brandon Williams
2018-02-27 18:23       ` Stefan Beller
2018-02-07  1:12     ` [PATCH v3 20/35] upload-pack: introduce fetch server command Brandon Williams
2018-02-21 23:46       ` Jonathan Tan
2018-02-22 18:48         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 21/35] fetch-pack: perform a fetch using v2 Brandon Williams
2018-02-24  0:54       ` Jonathan Tan
2018-02-26 22:23         ` Brandon Williams
2018-02-27 19:27       ` Stefan Beller
2018-02-27 19:40         ` Brandon Williams
2018-02-07  1:12     ` [PATCH v3 22/35] upload-pack: support shallow requests Brandon Williams
2018-02-07 19:00       ` Stefan Beller
2018-02-10 10:23         ` Duy Nguyen
2018-02-13 17:06         ` Brandon Williams
2018-02-27 18:29       ` Jonathan Nieder
2018-02-27 18:57         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 23/35] fetch-pack: " Brandon Williams
2018-02-23 19:37       ` Jonathan Tan
2018-02-23 19:56         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 24/35] connect: refactor git_connect to only get the protocol version once Brandon Williams
2018-02-21 23:51       ` Jonathan Tan
2018-02-07  1:13     ` [PATCH v3 25/35] connect: don't request v2 when pushing Brandon Williams
2018-02-07  1:13     ` [PATCH v3 26/35] transport-helper: remove name parameter Brandon Williams
2018-02-27 23:03       ` Jonathan Nieder
2018-02-07  1:13     ` [PATCH v3 27/35] transport-helper: refactor process_connect_service Brandon Williams
2018-02-07  1:13     ` [PATCH v3 28/35] transport-helper: introduce stateless-connect Brandon Williams
2018-02-22  0:01       ` Jonathan Tan
2018-02-22 18:53         ` Brandon Williams
2018-02-22 21:55           ` Jonathan Tan
2018-02-27 23:30       ` Jonathan Nieder
2018-02-28 19:09         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 29/35] pkt-line: add packet_buf_write_len function Brandon Williams
2018-02-27 23:11       ` Jonathan Nieder
2018-02-28  1:08         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 30/35] remote-curl: create copy of the service name Brandon Williams
2018-02-22  0:06       ` Jonathan Tan
2018-02-22 18:56         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 31/35] remote-curl: store the protocol version the server responded with Brandon Williams
2018-02-27 23:17       ` Jonathan Nieder
2018-02-07  1:13     ` [PATCH v3 32/35] http: allow providing extra headers for http requests Brandon Williams
2018-02-22  0:09       ` Jonathan Tan
2018-02-22 18:58         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 33/35] http: don't always add Git-Protocol header Brandon Williams
2018-02-07  1:13     ` [PATCH v3 34/35] remote-curl: implement stateless-connect command Brandon Williams
2018-02-28  0:05       ` Jonathan Nieder
2018-02-28 20:21         ` Brandon Williams
2018-02-07  1:13     ` [PATCH v3 35/35] remote-curl: don't request v2 when pushing Brandon Williams
2018-02-22  0:12       ` Jonathan Tan
2018-02-22 18:59         ` Brandon Williams
2018-02-22 19:09           ` Brandon Williams
2018-02-12 14:50     ` [PATCH v3 00/35] protocol version 2 Derrick Stolee
2018-02-21 20:01     ` Brandon Williams
2018-02-28 23:22     ` [PATCH v4 " Brandon Williams
2018-02-28 23:22       ` [PATCH v4 01/35] pkt-line: introduce packet_read_with_status Brandon Williams
2018-03-13 19:35         ` Jonathan Tan
2018-03-13 19:52           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 02/35] pkt-line: allow peeking a packet line without consuming it Brandon Williams
2018-03-01 20:48         ` Junio C Hamano
2018-03-12 21:56           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 03/35] pkt-line: add delim packet support Brandon Williams
2018-03-01 20:50         ` Junio C Hamano
2018-03-01 21:04           ` Junio C Hamano
2018-03-01 22:49             ` Brandon Williams
2018-03-01 23:43               ` Junio C Hamano
2018-02-28 23:22       ` [PATCH v4 04/35] upload-pack: convert to a builtin Brandon Williams
2018-03-13 16:40         ` Jonathan Tan
2018-03-13 19:50           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 05/35] upload-pack: factor out processing lines Brandon Williams
2018-03-01 21:25         ` Junio C Hamano
2018-03-12 22:24           ` Brandon Williams
2018-03-12 22:39             ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 06/35] transport: use get_refs_via_connect to get refs Brandon Williams
2018-03-01 21:25         ` Junio C Hamano
2018-02-28 23:22       ` [PATCH v4 07/35] connect: convert get_remote_heads to use struct packet_reader Brandon Williams
2018-02-28 23:22       ` [PATCH v4 08/35] connect: discover protocol version outside of get_remote_heads Brandon Williams
2018-03-13 15:49         ` Jonathan Tan
2018-02-28 23:22       ` [PATCH v4 09/35] transport: store protocol version Brandon Williams
2018-02-28 23:22       ` [PATCH v4 10/35] protocol: introduce enum protocol_version value protocol_v2 Brandon Williams
2018-02-28 23:22       ` [PATCH v4 11/35] test-pkt-line: introduce a packet-line test helper Brandon Williams
2018-02-28 23:22       ` [PATCH v4 12/35] serve: introduce git-serve Brandon Williams
2018-03-01 23:11         ` Junio C Hamano
2018-03-12 22:08           ` Brandon Williams
2018-03-02 20:42         ` Junio C Hamano
2018-03-13 21:40           ` Brandon Williams
2018-03-02 20:56         ` Junio C Hamano
2018-03-13 21:35           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 13/35] ls-refs: introduce ls-refs server command Brandon Williams
2018-03-02 21:13         ` Junio C Hamano
2018-03-13 21:27           ` Brandon Williams
2018-03-03  4:43         ` Jeff King
2018-03-05 18:21           ` Brandon Williams
2018-03-05 18:29             ` Jonathan Nieder
2018-03-05 20:38               ` Jeff King
2018-03-05 20:28             ` Jeff King
2018-03-13 21:23               ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 14/35] connect: request remote refs using v2 Brandon Williams
2018-02-28 23:22       ` [PATCH v4 15/35] transport: convert get_refs_list to take a list of ref patterns Brandon Williams
2018-02-28 23:22       ` [PATCH v4 16/35] transport: convert transport_get_remote_refs " Brandon Williams
2018-03-13 16:00         ` Jonathan Tan
2018-02-28 23:22       ` [PATCH v4 17/35] ls-remote: pass ref patterns when requesting a remote's refs Brandon Williams
2018-03-02 22:13         ` Junio C Hamano
2018-02-28 23:22       ` [PATCH v4 18/35] fetch: pass ref patterns when fetching Brandon Williams
2018-03-02 22:20         ` Junio C Hamano
2018-03-12 22:18           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 19/35] push: pass ref patterns when pushing Brandon Williams
2018-03-02 22:25         ` Junio C Hamano
2018-03-12 22:20           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 20/35] upload-pack: introduce fetch server command Brandon Williams
2018-03-13 16:20         ` Jonathan Tan
2018-03-13 21:49           ` Brandon Williams
2018-02-28 23:22       ` Brandon Williams [this message]
2018-02-28 23:22       ` [PATCH v4 22/35] fetch-pack: support shallow requests Brandon Williams
2018-02-28 23:22       ` [PATCH v4 23/35] connect: refactor git_connect to only get the protocol version once Brandon Williams
2018-02-28 23:22       ` [PATCH v4 24/35] connect: don't request v2 when pushing Brandon Williams
2018-02-28 23:22       ` [PATCH v4 25/35] transport-helper: remove name parameter Brandon Williams
2018-02-28 23:22       ` [PATCH v4 26/35] transport-helper: refactor process_connect_service Brandon Williams
2018-02-28 23:22       ` [PATCH v4 27/35] transport-helper: introduce stateless-connect Brandon Williams
2018-03-13 16:30         ` Jonathan Tan
2018-03-14 17:36           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 28/35] pkt-line: add packet_buf_write_len function Brandon Williams
2018-02-28 23:22       ` [PATCH v4 29/35] remote-curl: create copy of the service name Brandon Williams
2018-03-13 16:32         ` Jonathan Tan
2018-02-28 23:22       ` [PATCH v4 30/35] remote-curl: store the protocol version the server responded with Brandon Williams
2018-02-28 23:22       ` [PATCH v4 31/35] http: allow providing extra headers for http requests Brandon Williams
2018-03-13 16:33         ` Jonathan Tan
2018-02-28 23:22       ` [PATCH v4 32/35] http: don't always add Git-Protocol header Brandon Williams
2018-02-28 23:22       ` [PATCH v4 33/35] http: eliminate "# service" line when using protocol v2 Brandon Williams
2018-02-28 23:22       ` [PATCH v4 34/35] remote-curl: implement stateless-connect command Brandon Williams
2018-03-02 20:07         ` Johannes Schindelin
2018-03-05 19:35           ` Brandon Williams
2018-02-28 23:22       ` [PATCH v4 35/35] remote-curl: don't request v2 when pushing Brandon Williams
2018-03-13 16:35         ` Jonathan Tan
2018-03-01 18:41       ` [PATCH v4 00/35] protocol version 2 Junio C Hamano
2018-03-01 19:16         ` Brandon Williams
2018-03-01 20:59           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180228232252.102167-22-bmwill@google.com \
    --to=bmwill@google.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    --cc=stolee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).