Merge branch 'bw/server-options'
authorJunio C Hamano <gitster@pobox.com>
Wed, 23 May 2018 05:38:15 +0000 (14:38 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 May 2018 05:38:15 +0000 (14:38 +0900)
The transport protocol v2 is getting updated further.

* bw/server-options:
fetch: send server options when using protocol v2
ls-remote: send server options when using protocol v2
serve: introduce the server-option capability

1  2 
Documentation/git-ls-remote.txt
builtin/ls-remote.c
connect.c
fetch-pack.c
transport.c
index 6ad1e34afca4cd569798bfcbae9f99d038693b64,e5defb1b2d75ff3cd9ad0c3c3c805bf96e82583d..b9fd3770a6ce19c341c421e07b68985d89d94df5
@@@ -60,16 -60,14 +60,24 @@@ OPTION
        upload-pack only shows the symref HEAD, so it will be the only
        one shown by ls-remote.
  
 +--sort=<key>::
 +      Sort based on the key given. Prefix `-` to sort in descending order
 +      of the value. Supports "version:refname" or "v:refname" (tag names
 +      are treated as versions). The "version:refname" sort order can also
 +      be affected by the "versionsort.suffix" configuration variable.
 +      See linkgit:git-for-each-ref[1] for more sort options, but be aware
 +      keys like `committerdate` that require access to the objects
 +      themselves will not work for refs whose objects have not yet been
 +      fetched from the remote, and will give a `missing object` error.
 +
+ -o <option>::
+ --server-option=<option>::
+       Transmit the given string to the server when communicating using
+       protocol version 2.  The given string must not contain a NUL or LF
+       character.
+       When multiple `--server-option=<option>` are given, they are all
+       sent to the other side in the order listed on the command line.
  <repository>::
        The "remote" repository to query.  This parameter can be
        either a URL or the name of a remote (see the GIT URLS and
index ca3f04a839e79ecf361df5a1997da05c5d59a62d,3150bfb926128cc1c02839f3fd64bddae245fe6e..1a25df7ee15b45df142679286afdb0e8c55647dc
@@@ -46,7 -45,7 +46,8 @@@ int cmd_ls_remote(int argc, const char 
        const char *uploadpack = NULL;
        const char **pattern = NULL;
        struct argv_array ref_prefixes = ARGV_ARRAY_INIT;
 +      int i;
+       struct string_list server_options = STRING_LIST_INIT_DUP;
  
        struct remote *remote;
        struct transport *transport;
        transport = transport_get(remote, NULL);
        if (uploadpack != NULL)
                transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
+       if (server_options.nr)
+               transport->server_options = &server_options;
  
        ref = transport_get_remote_refs(transport, &ref_prefixes);
 -      if (transport_disconnect(transport))
 +      if (transport_disconnect(transport)) {
 +              UNLEAK(sorting);
                return 1;
 +      }
  
        if (!dest && !quiet)
                fprintf(stderr, "From %s\n", *remote->url);
diff --cc connect.c
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc transport.c
Simple merge