Git.Runner.Forcola (git v0.6.0)

Copy Markdown View Source

Leak-free runner backed by forcola.

Runs git in its own process group via a Rust shim and kills the whole group (SIGTERM then SIGKILL) on timeout or BEAM death. git and everything it spawned (ssh transports, credential helpers, hooks, sign helpers) die with the command, so a timed-out command does not leave a git process holding .git/index.lock or racing the caller.

This is the default runner (Git.Config sets runner: :forcola). It only compiles when the optional Forcola dependency is available; add it to your dependencies to get leak-free execution.

forcola is POSIX-only (macOS and Linux). On other platforms, or when the dependency is absent, the runner falls back to Git.Runner.SystemCmd.

Feeding stdin

When the runner opts carry :input (a binary or iodata), the bytes are written to git's stdin exactly as given and stdin is then closed, so commands that read stdin to EOF (hash-object --stdin, mktree, stripspace, patch-id, cat-file --batch) work. Forcola.run/2 has no stdin channel, so the input path drives forcola's shim wire protocol (Forcola.Shim) directly: SPAWN, one STDIN frame with the raw bytes, then EOF. Output and exit handling match the no-input path, including the group-kill-on-timeout guarantee. The no-input path stays on Forcola.run/2 unchanged.