Skip to content

fix(hooks): resolve hooks not executing on first run after upgrade#259

Merged
avihut merged 3 commits intomasterfrom
bugfix/no-hooks-on-upgrade-first-run
Feb 23, 2026
Merged

fix(hooks): resolve hooks not executing on first run after upgrade#259
avihut merged 3 commits intomasterfrom
bugfix/no-hooks-on-upgrade-first-run

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 23, 2026

Summary

  • Fix path canonicalization in checkout commands — replace private resolve_git_dir() with get_git_common_dir() from repo.rs which canonicalizes paths, fixing trust DB lookups on systems with symlinks (e.g. macOS /var -> /private/var)
  • Fix CommandBridge::run_hook() propagating result.stderr instead of result.skip_reason, which lost the actual skip reason
  • Add untrusted-hooks notice to go/start commands (previously only clone and adopt showed it)

Test Plan

  • mise run clippy — zero warnings
  • mise run fmt — clean
  • mise run test:unit — 6/6 passed
  • mise run test:integration — 198/198 passed (default + gitoxide backends)

🤖 Generated with Claude Code

avihut and others added 3 commits February 23, 2026 19:14
Replace private resolve_git_dir() with get_git_common_dir() from repo.rs
which canonicalizes the path. Without canonicalization, trust DB lookups
fail on systems with symlinks (e.g. macOS /var -> /private/var), causing
hooks to be silently skipped after install/upgrade.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CommandBridge::run_hook() was reading result.stderr instead of
result.skip_reason, losing the actual reason hooks were skipped
(e.g., "Repository not trusted").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously only clone and flow-adopt showed a notice when hooks were
skipped due to trust. Now go/start also inform the user how to enable
hooks with `git daft hooks trust`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut added this to the v1.1.0 milestone Feb 23, 2026
@avihut avihut added bug Something isn't working fix Bug fix labels Feb 23, 2026
@avihut avihut self-assigned this Feb 23, 2026
@avihut avihut merged commit a822362 into master Feb 23, 2026
6 checks passed
@avihut avihut deleted the bugfix/no-hooks-on-upgrade-first-run branch February 23, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant