refactor(git): extract kild-git crate from kild-core#618
Merged
Conversation
Move the self-contained git/ module into its own workspace crate, following the pattern of kild-config and kild-paths extractions. - Create crates/kild-git/ with all git operations (worktree management, branch health, status, queries, remote ops, naming, validation) - Extract detect_project/detect_project_at into kild-git::project - kild-core depends on kild-git and re-exports all public types/functions for backward compatibility - handler.rs (create_worktree) and overlaps.rs stay in kild-core since they depend on kild-core internals (files module, session types, config) - Move KildError impl for GitError to kild-core::errors (avoids circular dep) - Update all consumers (sessions, cleanup, CLI sync) to use git:: re-exports No behavior changes — pure structural extraction. Closes #587
Address review feedback:
- Gate kild-git test_support module behind `testing` feature flag so
test helpers don't ship in production binaries (restores #[cfg(test)]
behavior from before extraction)
- kild-core uses the feature via dev-dependencies for its tests
- Replace types::* glob import with explicit {ProjectInfo, WorktreeInfo}
in handler.rs
- Remove misleading inline module-source comments from re-export block
(items are alphabetically sorted, labels were inaccurate)
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.
Summary
git/module fromkild-coreinto a newcrates/kild-git/workspace cratekild-configandkild-pathsextractionskild-corere-exports all public types/functions for backward compatibility — no consumer changes needed beyond import pathshandler.rs(create_worktree) andoverlaps.rsstay inkild-coresince they depend on core internals (files module, session types)Test plan
cargo fmt --checkpassescargo clippy --all -- -D warningspassescargo build --allpassescargo test --allpasses (245 pass, 3 pre-existing env-sensitive failures unrelated to this change)Closes #587