]> git.ipfire.org Git - thirdparty/git.git/commit
sub-process: separate process lifecycle from hashmap management
authorMichael Montalbo <mmontalbo@gmail.com>
Sun, 26 Jul 2026 18:51:23 +0000 (18:51 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 26 Jul 2026 21:03:54 +0000 (14:03 -0700)
commited12685c3ead3a6e184d4e313a613249df06f32b
tree0db86abb6845f8c8d898bfac2d094cc3fb140fb3
parentf7af1e8f2c57a7e2f9ee30b59496f0ef8ff6a3c3
sub-process: separate process lifecycle from hashmap management

subprocess_start() and subprocess_stop() couple two concerns:
managing a child process (setup, handshake, teardown) and
managing a hashmap that indexes running processes by command
string.  The hashmap suits callers like convert.c where many
files may share one filter process looked up by name, but
callers that manage process lifetime through their own data
structures do not need it.

Extract subprocess_start_command() and subprocess_stop_command()
so callers can reuse the child process setup and handshake
machinery without maintaining a hashmap.  subprocess_start()
and subprocess_stop() become thin wrappers that add hashmap
operations on top.

Signed-off-by: Michael Montalbo <mmontalbo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sub-process.c
sub-process.h