Skip to content

Simple IPC Cleanups

Jeff Hostetler via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8pkt-line: remove buffer arg from write_packetized_from_fd_no_flush()convert.c pkt-line.c pkt-line.h+15 -171 reply
2/8unix-socket: simplify initialization of unix_stream_listen_optsunix-socket.c unix-socket.h+11 -71 reply
3/8unix-stream-server: create unix-stream-server.cMakefile compat/simple-ipc/ipc-unix-socket.c contrib/buildsystems/CMakeLists.txt +4 more+159 -1470 replies
4/8simple-ipc: move error handling up a levelcompat/simple-ipc/ipc-unix-socket.c compat/simple-ipc/ipc-win32.c simple-ipc.h +3 more+86 -600 replies
5/8unix-stream-server: add st_dev and st_mode to socket stolen checksunix-stream-server.c+4 -12 replies
6/8test-simple-ipc: refactor command line option processing in helpert/helper/test-simple-ipc.c+153 -1540 replies
7/8test-simple-ipc: add --token=<token> string optiont/helper/test-simple-ipc.c t/t0052-simple-ipc.sh+21 -140 replies
8/8simple-ipc: update design documentation with more detailsDocumentation/technical/api-simple-ipc.txt+101 -300 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/8] Simple IPC Cleanups

This patch series adds a few final cleanup and refactoring commits onto the jh/simple-ipc branch. These are in response to mailing list comments that I received on my V4 version after it was queued into next.

https://lore.kernel.org/git/[email protected]/T/#mbd1da5ff93ef273049090f697aeab68c74f698f1

There are a couple of large changes that I'll call out here.

In the third commit, I moved the new lock-aware code out of unix-socket.c and into its own source file. This creates a slightly misleading diff at times (in gitk) where it looks like 51% copy of unix-socket.c rather than a new file. On the command line and on GitHub it looks better.

In the commits prefixed with test-simple-ipc: ... I refactored the options parsing to allow the name of the socket/named-pipe to be passed on the command line so that the Windows version could do so (since it needs to exec a child rather than fork). This turned into a larger cleanup/refactoring than I had expected, but I think the result is much better. I unified all of the option parsing into the main cmd__simple_ipc() function and got rid of the smaller parsers inside of each subcommand. With this, all of the subcommands now allow an alternate socket path to be used. (Just fixing the unused arg on the Windows side would allow us to spawn a background daemon on a different socket, but none of the client subcommands would be able to talk to it.)

Jeff Hostetler (8):
pkt-line: remove buffer arg from write_packetized_from_fd_no_flush()
unix-socket: simplify initialization of unix_stream_listen_opts
unix-stream-server: create unix-stream-server.c
simple-ipc: move error handling up a level
unix-stream-server: add st_dev and st_mode to socket stolen checks
test-simple-ipc: refactor command line option processing in helper
test-simple-ipc: add --token=<token> string option
simple-ipc: update design documentation with more details

 Documentation/technical/api-simple-ipc.txt | 131 +++++++--
 Makefile                                   |   1 +
 compat/simple-ipc/ipc-unix-socket.c        |  49 ++--
 compat/simple-ipc/ipc-win32.c              |  14 +-
 contrib/buildsystems/CMakeLists.txt        |   2 +-
 convert.c                                  |   7 +-
 pkt-line.c                                 |  19 +-
 pkt-line.h                                 |   6 +-
 simple-ipc.h                               |   4 +
 t/helper/test-simple-ipc.c                 | 326 +++++++++++----------
 t/t0052-simple-ipc.sh                      |  10 +-
 unix-socket.c                              | 117 +-------
 unix-socket.h                              |  33 +--
 unix-stream-server.c                       | 130 ++++++++
 unix-stream-server.h                       |  35 +++
 15 files changed, 502 insertions(+), 382 deletions(-)
 create mode 100644 unix-stream-server.c
 create mode 100644 unix-stream-server.h

base-commit: edce16a37ab87513a3f0bc805e9bf372bdd02961
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-893%2Fjeffhostetler%2Fnext-simple-ipc-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-893/jeffhostetler/next-simple-ipc-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/893

Signature · 1 line
gitgitgadget