Files
dotfiles/git/hooks
David F GliddenandClaude Opus 4.8 dff8b7c452 [FIX] pre-commit: probe /dev/tty by opening it, not testing existence
On macOS /dev/tty always exists, so '[ -e /dev/tty ]' passed even in agent
harnesses/CI with no controlling terminal — the subsequent read then died
with ENXIO ('Device not configured') and blocked the commit instead of taking
the hook's own non-interactive branch. Probe with '( : < /dev/tty )' — the
exact operation that fails. Both prompt sites fixed; the deliberate asymmetry
preserved (debug keywords warn-and-proceed; secrets fail closed). Verified
both paths from a non-TTY context. Surfaced via the be a11y-gate commit
bypass logged in today's ledger.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 18:43:37 +02:00
..

Git Hooks

This directory contains global git hooks that can be used across all repositories.

Setup

  1. Configure git to use this directory for hooks:
git config --global core.hooksPath ~/dotfiles/git/hooks
  1. Make hooks executable:
chmod +x ~/dotfiles/git/hooks/*

Available Hooks

  • pre-commit: Run before each commit
  • commit-msg: Validate commit messages
  • pre-push: Run before pushing

Per-Repository Hooks

To use repository-specific hooks instead of global ones:

git config --local core.hooksPath .git/hooks