mbox series

[v3,0/1] Advertise multiple supported proto versions

Message ID cover.1542059029.git.steadmon@google.com (mailing list archive)
Headers show
Series Advertise multiple supported proto versions | expand

Message

Josh Steadmon Nov. 12, 2018, 9:49 p.m. UTC
This is a minor iteration on v2, to change an error message to a BUG.

Josh Steadmon (1):
  protocol: advertise multiple supported versions

 builtin/archive.c      |   3 ++
 builtin/clone.c        |   4 ++
 builtin/fetch-pack.c   |   4 ++
 builtin/fetch.c        |   5 ++
 builtin/ls-remote.c    |   5 ++
 builtin/pull.c         |   5 ++
 builtin/push.c         |   4 ++
 builtin/send-pack.c    |   3 ++
 connect.c              |  47 ++++++++---------
 protocol.c             | 112 ++++++++++++++++++++++++++++++++++++++---
 protocol.h             |  17 +++++++
 remote-curl.c          |  28 +++++++----
 t/t5570-git-daemon.sh  |   2 +-
 t/t5700-protocol-v1.sh |   8 +--
 t/t5702-protocol-v2.sh |  16 +++---
 transport-helper.c     |   6 +++
 16 files changed, 214 insertions(+), 55 deletions(-)

Range-diff against v2:
1:  70986cec32 ! 1:  b9968e3fb0 protocol: advertise multiple supported versions
    @@ -358,7 +358,7 @@
     +void register_allowed_protocol_version(enum protocol_version version)
     +{
     +	if (have_advertised_versions_already)
    -+		error(_("attempting to register an allowed protocol version after advertisement"));
    ++		BUG(_("attempting to register an allowed protocol version after advertisement"));
     +
     +	ALLOC_GROW(allowed_versions, nr_allowed_versions + 1,
     +		   alloc_allowed_versions);
    @@ -395,7 +395,6 @@
     +	config_version = get_protocol_version_config();
     +	if (config_version == protocol_v0) {
     +		strbuf_addstr(advert, "version=0");
    -+		trace_printf("Client advert string: %s", advert->buf);
     +		return;
     +	}
     +
    @@ -424,8 +423,6 @@
     +	for (int i = 1; i < tmp_nr; i++)
     +		strbuf_addf(advert, ":version=%s",
     +			    format_protocol_version(tmp_allowed_versions[i]));
    -+
    -+	trace_printf("Client advert string: %s", advert->buf);
     +}
     +
      enum protocol_version determine_protocol_version_server(void)