Skip to content

refactor(git): extract kild-git crate from kild-core#618

Merged
Wirasm merged 2 commits into
mainfrom
kild/extract-kild-git
Feb 27, 2026
Merged

refactor(git): extract kild-git crate from kild-core#618
Wirasm merged 2 commits into
mainfrom
kild/extract-kild-git

Conversation

@Wirasm

@Wirasm Wirasm commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Extract the self-contained git/ module from kild-core into a new crates/kild-git/ workspace crate
  • Follows the established pattern of kild-config and kild-paths extractions
  • kild-core re-exports all public types/functions for backward compatibility — no consumer changes needed beyond import paths
  • handler.rs (create_worktree) and overlaps.rs stay in kild-core since they depend on core internals (files module, session types)

Test plan

  • cargo fmt --check passes
  • cargo clippy --all -- -D warnings passes
  • cargo build --all passes
  • cargo test --all passes (245 pass, 3 pre-existing env-sensitive failures unrelated to this change)
  • kild-git crate runs 119 tests independently

Closes #587

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)
@Wirasm Wirasm merged commit 8c8851d into main Feb 27, 2026
6 checks passed
@Wirasm Wirasm deleted the kild/extract-kild-git branch February 27, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract kild-git crate from kild-core

1 participant