Conversation
Add `daft hooks trust prune` to remove stale entries from the trust database (paths that no longer exist on disk). Also runs automatically in the background once per 24 hours using the same fire-and-forget detached process pattern as the update check. Disable auto-pruning with `git config --global daft.hooks.trustPrune false` or `DAFT_NO_TRUST_PRUNE=1`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shell completions for `daft hooks`, `daft hooks status`, `daft hooks trust`, `daft hooks prompt`, and `daft hooks deny` now complete directory paths for the [PATH] argument. Also adds flag completions for these subcommands and the missing -v/--verbose flag for hooks run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…smatches Clone stored relative paths (e.g. "tax-analyzer/.git") in the trust database, but all lookups used canonicalized absolute paths from get_git_common_dir(). This caused --trust-hooks to appear ineffective: the entry existed in trust list but was never found during lookup. Fix by canonicalizing paths in all TrustDatabase methods (get, set, remove, has_explicit_trust) so both sides always use consistent absolute paths. Also canonicalize git_dir in clone after bare clone succeeds, ensuring hook execution context uses the canonical path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a repository is trusted, store the remote URL as a fingerprint. On hook execution, verify the fingerprint matches the current remote — a mismatch (e.g., different repo cloned to same path) downgrades trust to prompt with a warning. Legacy entries without fingerprints continue to work unchanged. Also removes stale trust entries when cloning without --trust-hooks to a path that already has a trust entry, and backfills fingerprints for existing entries during prune (both manual and background). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
promptwith a warning — preventing silent trust inheritance--trust-hooksto a path that already has a trust entry, the stale entry is removed since the old repo was replacedprunecommand (and background auto-prune) now backfills fingerprints for existing entries that lack themhooks trust/deny/resetsubcommandsTest plan
mise run fmt— cleanmise run clippy— zero warningsmise run test:unit— 414 pass, 0 fail--trust-hooks→ verifytrust.jsonhasfingerprintfielddaft hooks trust list→ verify fingerprint shownFixes #278
🤖 Generated with Claude Code