Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
ahmedelq opened this issue May 13, 2024 · 1 comment
Open
1 task done

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

ahmedelq opened this issue May 13, 2024 · 1 comment

Comments

@ahmedelq
Copy link

ahmedelq commented May 13, 2024

Troubleshoot

Context
Please describe your issue and provide some context:

  • env: Ubuntu 22.04, Bash 5.1.16, git version 2.34.1, husky: 9.0.11
  • git config core.hooksPath gives: .husky/_

Steps to reproduce

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

Expected behavior: fail the git commit.

Thank you!

@typicode
Copy link
Owner

typicode commented May 14, 2024

Commands should be put in .husky/commit-msg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants