The sub-process API makes it possible to run background sub-processes for the entire lifetime of a Git invocation. If Git needs to communicate with an external process multiple times, then this can reduces the process invocation overhead. Git and the sub-process communicate through stdin and stdout.
The sub-processes are kept in a hashmap by command name and looked up via the subprocess_find_entry function. If an existing instance can not be found then a new process should be created and started. When the parent git command terminates, all sub-processes are also terminated.
This API is based on the run-command API.
struct subprocess_entry
The sub-process structure. Members should not be accessed directly.
User-supplied function to initialize the sub-process. This is typically used to negotiate the interface version and capabilities.
Function to test two subprocess hashmap entries for equality.
Start a subprocess and add it to the subprocess hashmap.
Kill a subprocess and remove it from the subprocess hashmap.
Find a subprocess in the subprocess hashmap.
Get the underlying struct child_process from a subprocess.
Helper function to read packets looking for the last "status=<foo>" key/value pair.