Skip to content

fix(hooks): skip prompt when trust level unchanged#371

Merged
avihut merged 1 commit intomasterfrom
fix/dont-prompt-hooks-with-no-change
Apr 21, 2026
Merged

fix(hooks): skip prompt when trust level unchanged#371
avihut merged 1 commit intomasterfrom
fix/dont-prompt-hooks-with-no-change

Conversation

@avihut
Copy link
Copy Markdown
Owner

@avihut avihut commented Apr 21, 2026

Summary

  • daft hooks trust and daft hooks prompt now short-circuit when the
    target level matches the current level, printing
    Trust: already at <level>, nothing to do. and returning without a
    confirmation prompt or trust-database write.
  • Guard lives at the top of cmd_set_trust in src/commands/hooks/trust.rs,
    before any prompt logic, so it applies with or without --force.
  • cmd_deny already handles the equivalent no-op via has_explicit_trust.

Test plan

  • mise run fmt
  • mise run clippy
  • mise run test:manual -- --ci hooks:trust-noop — new regression
    scenario runs daft hooks trust twice and daft hooks prompt twice,
    asserting that the second invocation exits 0 and contains
    "already at" / "nothing to do" without blocking on stdin.

🤖 Generated with Claude Code

@avihut avihut added this to the Public Launch milestone Apr 21, 2026
@avihut avihut added the fix Bug fix label Apr 21, 2026
@avihut avihut self-assigned this Apr 21, 2026
Running `daft hooks trust` or `daft hooks prompt` against a repo already
at the target level now prints "already at <level>, nothing to do." and
returns without prompting or writing to the trust database.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@avihut avihut force-pushed the fix/dont-prompt-hooks-with-no-change branch from b2606c1 to 66960c3 Compare April 21, 2026 05:43
@avihut avihut merged commit cf1d337 into master Apr 21, 2026
8 checks passed
@avihut avihut deleted the fix/dont-prompt-hooks-with-no-change branch April 21, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant