17 Matching Annotations
  1. Last 7 days
    1. pre-commit hooks are fundamentally broken
      • Article argues pre-commit hooks are fundamentally broken due to running on working tree, not index, failing to catch unstaged changes.
      • Hooks interfere with rebases, interactive commits, and external branches without hooks, requiring frequent --no-verify usage.
      • Demonstrates issues via Rust fizzbuzz example: formatting fixes don't stage, existing unformatted code blocks commits, rebases fail unexpectedly.
      • Recommends pre-push hooks instead: run on index, keep fast/reliable (no network/credentials), quiet, manual setup via docs.
      • Additional pitfalls: slow/unreliable implementations, modifying commits, not running on stashes; prefers commits over stashes for branching.

      Hacker News Discussion

      • Users debate pre-commit vs. pre-push/CI: enforce in CI for reliability, use hooks to reduce churn but not guarantee (e.g., secrets in pre-push).
      • Workflows vary: WIP commits common, rebase/squash before push; hooks break rebases needing full checkouts (e.g., cargo clippy).
      • Editor integration preferred for formatting/linting; force consistency in teams but allow bypass for power users.
      • Alternatives: git filters for formatting, jj run for future; personal setups run heavy local checks but optional for contributors.
      • Defenses of pre-commit frameworks (speed, environments) countered by author; prefer CI for shared enforcement over local hooks.
  2. Apr 2025
  3. Feb 2023
  4. Nov 2022
    1. It is handy to manually generate the diagram from times to times using the previously created command: npm run db:diagram:generate. Though, getting the diagram to update itself on its own automatically without a developer interaction would ensure that it the diagram is never obsolete. There are several ways of doing this.You could use a pre-commit git hook or even better simply configure your CI/CD pipeline(s) to run the npm script whenever something gets merged into the main branch 🙂
  5. Aug 2022
  6. Jun 2021
  7. Jun 2020