Merge branch 'jt/subprocess-handshake'
authorJunio C Hamano <gitster@pobox.com>
Fri, 11 Aug 2017 20:27:05 +0000 (13:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 11 Aug 2017 20:27:05 +0000 (13:27 -0700)
Code cleanup.

* jt/subprocess-handshake:
sub-process: refactor handshake to common function
Documentation: migrate sub-process docs to header

1  2 
convert.c
sub-process.c
sub-process.h
diff --cc convert.c
Simple merge
diff --cc sub-process.c
Simple merge
diff --cc sub-process.h
index 8cd07a59ab4344fdc9a5b35b201a075aa7c06423,caa91a9b92f2256a33d3330b1084a205bef98632..49701998c9bd663073244e64c4edd7e80991a3ef
@@@ -18,14 -29,31 +29,31 @@@ struct subprocess_entry 
        struct child_process process;
  };
  
+ struct subprocess_capability {
+       const char *name;
+       /*
+        * subprocess_handshake will "|=" this value to supported_capabilities
+        * if the server reports that it supports this capability.
+        */
+       unsigned int flag;
+ };
  /* subprocess functions */
  
+ /* Function to test two subprocess hashmap entries for equality. */
  extern int cmd2process_cmp(const void *unused_cmp_data,
 -                         const struct subprocess_entry *e1,
 -                         const struct subprocess_entry *e2,
 +                         const void *e1,
 +                         const void *e2,
                           const void *unused_keydata);
  
+ /*
+  * User-supplied function to initialize the sub-process.  This is
+  * typically used to negotiate the interface version and capabilities.
+  */
  typedef int(*subprocess_start_fn)(struct subprocess_entry *entry);
+ /* Start a subprocess and add it to the subprocess hashmap. */
  int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, const char *cmd,
                subprocess_start_fn startfn);