Migrate from ShellKit to swift-subprocess; make the API async-only - #24
Open
armcknight wants to merge 1 commit into
Open
Migrate from ShellKit to swift-subprocess; make the API async-only#24armcknight wants to merge 1 commit into
armcknight wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed
binarybirds/shell-kitis 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.