typicode / husky

Git hooks made easy 🐶 woof!
https://typicode.github.io/husky
MIT License
32.32k stars 1.02k forks source link

`.husky/_/commit-msg` not triggered with `git commit -m "test"` #1440

Closed ahmedelq closed 3 weeks ago

ahmedelq commented 3 months ago

Troubleshoot

Context Please describe your issue and provide some context:

Steps to reproduce

  1. Edit .husky/_/commit-msg with the below:
    #!/usr/bin/env sh
    . "${0%/*}/h"
    echo "test $1"
    exit 1
  2. git commit -m "testing"
  3. Nothing gets printed out and commit message is accepted.

Expected behavior: fail the git commit.

Thank you!

typicode commented 3 months ago

Commands should be put in .husky/commit-msg

irfan-nawaz commented 3 months ago

what is _ folder then where can I read about it ?

typicode commented 3 weeks ago

It's a directory owned by husky to put necessary files for it to work. Consider it like node_modules. In any case, files inside shouldn't be edited.