Re: [PATCH v3 7/8] sub-process: move sub-process functions into separate files

2 messages, 2 authors, 2017-03-30 · open the first message on its own page

Re: [PATCH v3 7/8] sub-process: move sub-process functions into separate files

From: Junio C Hamano <hidden>
Date: 2017-03-29 20:47:05

Ben Peart [off-list ref] writes:
+Types
+-----
+
+'int(*subprocess_start_fn)(struct subprocess_entry *entry)'::
+
+	User-supplied function to initialize the sub-process.  This is
+	typically used to negoiate the interface version and capabilities.
+
+
+Functions
+---------
+
+`subprocess_start`::
+
+	Start a subprocess and add it to the subprocess hashmap.
+
+`subprocess_stop`::
+
+	Kill a subprocess and remove it from the subprocess hashmap.
+
+`subprocess_find_entry`::
+
+	Find a subprocess in the subprocess hashmap.
+
+`subprocess_get_child_process`::
+
+	Get the underlying `struct child_process` from a subprocess.
+
+`subprocess_read_status`::
+
+	Helper function to read packets looking for the last "status=<foo>"
+	key/value pair.
OK.
quoted hunk
diff --git a/sub-process.c b/sub-process.c
new file mode 100644
index 0000000000..2c4d27c193
--- /dev/null
+++ b/sub-process.c
@@ -0,0 +1,116 @@
+/*
+ * Generic implementation of background process infrastructure.
+ */
+#include "sub-process.h"
+#include "sigchain.h"
+#include "pkt-line.h"
+ ...
+void subprocess_exit_handler(struct child_process *process)
+{
This is not only undocumented in the above, but it does not seem to
be necessary to be a public function.  The only thing that uses this
is subprocess_start(), which is in this file.  Perhaps make it static?

RE: [PATCH v3 7/8] sub-process: move sub-process functions into separate files

From: Ben Peart <hidden>
Date: 2017-03-30 15:27:22

From: Junio C Hamano [mailto:gitster@pobox.com]
quoted
diff --git a/sub-process.c b/sub-process.c new file mode 100644 index
0000000000..2c4d27c193
--- /dev/null
+++ b/sub-process.c
@@ -0,0 +1,116 @@
+/*
+ * Generic implementation of background process infrastructure.
+ */
+#include "sub-process.h"
+#include "sigchain.h"
+#include "pkt-line.h"
+ ...
+void subprocess_exit_handler(struct child_process *process) {
This is not only undocumented in the above, but it does not seem to be
necessary to be a public function.  The only thing that uses this is
subprocess_start(), which is in this file.  Perhaps make it static?
OK.  Missed that somehow. I'll fix it and send another patch series.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help