Skip to content

feat: add hook uninstall, init aliases, and CLI subcommands - #56

Merged
pixincreate merged 18 commits into
masterfrom
feature/hook-uninstall-alias-init
May 8, 2026
Merged

feat: add hook uninstall, init aliases, and CLI subcommands#56
pixincreate merged 18 commits into
masterfrom
feature/hook-uninstall-alias-init

Conversation

@pixincreate

@pixincreatepixincreate commented May 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add first-class key-watch hook uninstall support for local and global Git hooks with safety checks (refuses to remove non-KeyWatch hooks)
  • Add key-watch init <shell> to print shell aliases for keywatch and kw, removing duplicate wrapper binaries
  • Redesign CLI around subcommands: scan, hook install|uninstall, init, and verify-integrity
  • Add regression coverage for overlapping scan roots with root-relative exclude patterns

Changes

  • Hooks: Uninstall now validates global hooks, refuses to remove foreign hooks, resolves hooks dir via git rev-parse --git-path hooks for worktree/submodule compatibility
  • CLI: All commands moved under subcommands; hook templates updated to use scan subcommand
  • Tests: Expanded coverage for hooks, scanner, report, and lib modules

Verification

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test

@pixincreate
pixincreateforce-pushed the feature/hook-uninstall-alias-init branch from 3a20e30 to 83276a0CompareMay 5, 2026 12:49
@pixincreate
pixincreate requested a review from CopilotMay 5, 2026 13:01
@pixincreatepixincreate self-assigned this May 5, 2026
@pixincreatepixincreate added the enhancement New feature or request label May 5, 2026

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends KeyWatch’s CLI to support uninstalling git hooks (local and global via core.hooksPath) and introduces key-watch --init <shell> to provide keywatch/kw aliases without shipping extra binaries, alongside updated distribution docs/changelog.

Changes:

  • Added --uninstall-hook and --global support for managing hooks in repo-local .git/hooks or Git’s global hooks directory.
  • Added --init bash|zsh|fish|posix to print shell alias initialization for keywatch and kw.
  • Removed duplicate wrapper binaries and the install script; updated README + changelog to reflect the new install/uninstall flows.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
FileDescription
src/lib.rsImplements global/local hook install target resolution, hook uninstall, and shell init output; adds unit tests for hooks-path resolution/safety.
src/cli.rsExtends CLI options and argument grouping for --uninstall-hook, --global, and --init.
tests/hooks_tests.rsUpdates option construction and adds clap parsing tests for --global/--init interactions.
tests/scanner_tests.rsUpdates option construction to include new CLI fields.
README.mdUpdates installation/uninstallation docs; documents global hooks and alias init flow.
CHANGELOG.mdRecords the new hook uninstall/global hooks/init changes; notes removal of wrapper binaries/install script.
Cargo.tomlRemoves explicit [[bin]] entries for wrapper binaries (relying on default src/main.rs).
src/bin/watch.rsRemoved wrapper binary.
src/bin/keywatch.rsRemoved wrapper binary.
scripts/install.shRemoved install/uninstall script in favor of documented flows.

Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs
Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs
Comment threadsrc/lib.rs
@pixincreate
pixincreate requested a review from CopilotMay 6, 2026 17:32
@pixincreatepixincreate changed the title feat: add hook uninstall and alias initfeat: add hook uninstall, alias init, and CLI subcommandsMay 7, 2026
@pixincreate
pixincreateforce-pushed the feature/hook-uninstall-alias-init branch from 9a06069 to 9b82eebCompareMay 7, 2026 16:32
@pixincreate
pixincreateforce-pushed the feature/hook-uninstall-alias-init branch from 9b82eeb to c867712CompareMay 7, 2026 16:33
@pixincreate
pixincreate requested review from Copilot and removed request for CopilotMay 7, 2026 16:34

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Comment threadsrc/lib.rs
Comment threadsrc/lib.rs Outdated
Comment threadsrc/lib.rs Outdated
Comment threadsrc/cli.rs
Comment threadsrc/lib.rs

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.

Comment threadsrc/scanner.rs
Comment threadsrc/lib.rs Outdated
Comment threadCHANGELOG.md Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Comment threadsrc/cli.rs Outdated
Comment threadtests/hooks_tests.rs
@pixincreatepixincreate changed the title feat: add hook uninstall, alias init, and CLI subcommandsfeat: add hook uninstall, init aliases, and CLI subcommandsMay 8, 2026
@pixincreate
pixincreateforce-pushed the feature/hook-uninstall-alias-init branch from 876ac25 to 32f443bCompareMay 8, 2026 10:23
@pixincreate
pixincreate merged commit b143078 into masterMay 8, 2026
5 checks passed
@pixincreate
pixincreate deleted the feature/hook-uninstall-alias-init branch May 8, 2026 11:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pixincreate