Skip to content

Migrate from ShellKit to swift-subprocess; make the API async-only - #24

Open
armcknight wants to merge 1 commit into
BinaryBirds:mainfrom
armcknight:async-subprocess-migration
Open

Migrate from ShellKit to swift-subprocess; make the API async-only#24
armcknight wants to merge 1 commit into
BinaryBirds:mainfrom
armcknight:async-subprocess-migration

Conversation

@armcknight

@armcknight armcknight commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

I noticed binarybirds/shell-kit is gone, so moved git-kit to use swiftlang/swift-subprocess. That's an asynchronous api, so also moved git-kit to be async-only, jettisoning the older block-based APIs.

binarybirds/shell-kit was deleted from GitHub. `swift build` can no longer
resolve it, so a fresh checkout of main fails for everyone.

Rather than vendor a copy of Shell.swift, this moves GitKit onto
swiftlang/swift-subprocess, the official async process API. Git no longer
subclasses Shell; it owns its own execution primitive.

This is a breaking change, so it warrants a major version:

- run() is async throws. The synchronous variant and the completion-handler
  variant are both removed.
- Shell.Error becomes Git.Error, with the same outputData and
  generic(Int, String) cases.
- path, verbose, type and env move onto Git unchanged; maxOutputSize is new
  (16MB default). The macOS-only outputHandler/errorHandler streaming hooks
  are gone.
- platforms is now macOS 13, swift-subprocess's floor.

Execution semantics are preserved deliberately: commands still run through
/bin/sh -c, so `cd "path" && git ...` composition, .raw() strings and the
shell quoting in .commit all behave exactly as before. The Alias and Command
enums are untouched, so the only change at a call site is the await.

Tests are converted to async/await; all 23 still pass. LinuxMain and
XCTestManifests are removed since they cannot express async tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant