Skip to content

Conversation

@jd
Copy link
Member

@jd jd commented Jan 24, 2026

Add a new stack hooks command that displays the status of both git
hooks and Claude hooks. The existing stack setup command becomes an
alias for stack hooks --setup.

  • mergify stack hooks shows detailed status of all hooks
  • mergify stack hooks --setup installs/upgrades hooks
  • mergify stack hooks --setup --force forces wrapper reinstall
  • mergify stack setup works as before (backwards compatible)
  • mergify stack setup --check shows status (deprecated in favor of hooks)

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

@jd
Copy link
Member Author

jd commented Jan 24, 2026

This pull request is part of a stack:

  1. feat(stack): add hooks subcommand for status display (#933) 👈
  2. refactor(stack): extract _get_hooks_dir() helper (#934)
  3. refactor(stack): extract _get_script_resource_path() helper (#935)
  4. refactor(stack): use as_file() for package resource copying (#937)

@mergify mergify bot had a problem deploying to Mergify Merge Protections January 24, 2026 16:28 Failure
@mergify
Copy link
Contributor

mergify bot commented Jan 24, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@mergify
Copy link
Contributor

mergify bot commented Jan 24, 2026

🧪 CI Insights

Here's what we observed from your CI run for 22edf5f.

🟢 All jobs passed!

But CI Insights is watching 👀

@jd jd force-pushed the devs/jd/version-hooks/I45910d02a514ed45f8b6d0becf58d36dce2a51f5 branch from dfaf488 to d2b3175 Compare January 24, 2026 17:25
@mergify mergify bot had a problem deploying to Mergify Merge Protections January 24, 2026 17:25 Failure
@jd jd force-pushed the devs/jd/version-hooks/I23a8e9fd0cf3468418a856420ee51ec104ae1cb3 branch from d957766 to 2ddf3dd Compare January 25, 2026 13:35
@jd jd force-pushed the devs/jd/version-hooks/I45910d02a514ed45f8b6d0becf58d36dce2a51f5 branch from d2b3175 to 843ec91 Compare January 25, 2026 13:35
@mergify mergify bot had a problem deploying to Mergify Merge Protections January 25, 2026 13:36 Failure
@jd jd force-pushed the devs/jd/version-hooks/I23a8e9fd0cf3468418a856420ee51ec104ae1cb3 branch from 2ddf3dd to 3a3cb1c Compare January 25, 2026 14:32
@jd jd force-pushed the devs/jd/version-hooks/I45910d02a514ed45f8b6d0becf58d36dce2a51f5 branch from 843ec91 to dd362a1 Compare January 25, 2026 14:32
@mergify mergify bot had a problem deploying to Mergify Merge Protections January 25, 2026 14:33 Failure
@mergify mergify bot requested a review from a team January 25, 2026 14:34
remyduthu
remyduthu previously approved these changes Jan 26, 2026
Base automatically changed from devs/jd/version-hooks/I23a8e9fd0cf3468418a856420ee51ec104ae1cb3 to main January 26, 2026 12:14
@mergify
Copy link
Contributor

mergify bot commented Jan 26, 2026

@jd this pull request is now in conflict 😩

@mergify mergify bot added the conflict label Jan 26, 2026
@jd jd force-pushed the devs/jd/version-hooks/I45910d02a514ed45f8b6d0becf58d36dce2a51f5 branch from dd362a1 to c3dbb6e Compare January 26, 2026 12:53
Copilot AI review requested due to automatic review settings January 26, 2026 12:53
@mergify mergify bot removed the conflict label Jan 26, 2026
@mergify mergify bot dismissed remyduthu’s stale review January 26, 2026 12:53

Pull request has been modified.

@mergify mergify bot had a problem deploying to Mergify Merge Protections January 26, 2026 12:53 Failure
@mergify mergify bot requested a review from a team January 26, 2026 12:55
Copy link

Copilot AI left a comment

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 adds a new stack hooks subcommand that displays the status of both git hooks and Claude hooks, improving the user experience by providing better visibility into hook installation state. The existing stack setup command is preserved as an alias for backwards compatibility.

Changes:

  • Added new stack hooks command to display detailed hook status and optionally install/upgrade hooks with --setup flag
  • Refactored setup.py to extract helper functions (_get_hook_command, _read_claude_settings, _claude_script_needs_update, _get_claude_hook_scripts) for better code organization
  • Added get_hooks_status() and _get_claude_hooks_status() functions to gather detailed status information
  • Maintained backwards compatibility by making stack setup an alias that calls the same underlying functions

Reviewed changes

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

File Description
mergify_cli/tests/stack/test_setup.py Added comprehensive tests for the new get_hooks_status() function and CLI commands, testing various hook installation states and command interactions
mergify_cli/stack/setup.py Refactored to extract helper functions, added status-checking functions, and removed the check_only parameter from stack_setup()
mergify_cli/stack/cli.py Added new hooks command with status display and setup functionality, updated setup command to delegate to new functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add a new `stack hooks` command that displays the status of both git
hooks and Claude hooks. The existing `stack setup` command becomes an
alias for `stack hooks --setup`.

- `mergify stack hooks` shows detailed status of all hooks
- `mergify stack hooks --setup` installs/upgrades hooks
- `mergify stack hooks --setup --force` forces wrapper reinstall
- `mergify stack setup` works as before (backwards compatible)
- `mergify stack setup --check` shows status (deprecated in favor of `hooks`)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change-Id: I45910d02a514ed45f8b6d0becf58d36dce2a51f5
Claude-Session-Id: 3dabd187-059b-40b7-9a52-a2542a27c752
@jd jd force-pushed the devs/jd/version-hooks/I45910d02a514ed45f8b6d0becf58d36dce2a51f5 branch from c3dbb6e to 22edf5f Compare January 26, 2026 13:13
@mergify mergify bot deployed to Mergify Merge Protections January 26, 2026 13:13 Active
@mergify mergify bot merged commit 6face94 into main Jan 26, 2026
18 checks passed
@mergify mergify bot deleted the devs/jd/version-hooks/I45910d02a514ed45f8b6d0becf58d36dce2a51f5 branch January 26, 2026 15:54
@mergify
Copy link
Contributor

mergify bot commented Jan 26, 2026

Merge Queue Status

✅ The pull request has been merged at 22edf5f

This pull request spent 14 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

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.

3 participants