You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fails during the first commit of a just initiated repo when other hooks than check-message are activated as it seems to rely on the git log command that raises an error because the logs are empty.
For example, when the hook check-commit-signoff is activated:
Commit rejected.
Type commit_signoff check failed => fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
It doesn't match regex: Signed-off-by:.*[A-Za-z0-9]\s+<.+@.+>
Signed-off-by not found in latest commit
Suggest: run command `git commit -m "conventional commit message" --signoff`
For check-commit-signoffc hook, it looks to work as expected.
BUT it should be not failed instead of skip this hook
(.venv) sxp@pc ~/c/test (main)> pre-commit try-repo ../commit-check check-commit-signoff
===============================================================================
Using config:
===============================================================================
repos:
- repo: ../commit-check
rev: 89249ec38cea1b9a168b69751b94ba45b7766ab7
hooks:
- id: check-commit-signoff
===============================================================================
[INFO] Initializing environment for ../commit-check.
[INFO] Installing environment for ../commit-check.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check committer signoff..................................................Failed
- hook id: check-commit-signoff
- exit code: 1
Commit rejected by Commit-Check.
(c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c) (c).-.(c)
/ ._. \ / ._. \ / ._. \ / ._. \ / ._. \
__\( C )/__ __\( H )/__ __\( E )/__ __\( C )/__ __\( K )/__
(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)(_.-/'-'\-._)
|| E |||| R |||| R |||| O |||| R ||
_.''-''._ _.''-''._ _.''-''._ _.''-''._ _.''-''._
(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)(.-./`-´\.-.)`-´ `-´ `-´ `-´ `-´ `-´ `-´ `-´ `-´ `-´Commit rejected.Type commit_signoff check failed => Repo has no commits yet.It doesn't match regex: Signed-off-by:.*[A-Za-z0-9]\s+<.+@.+>Signed-off-by not found in latest commitSuggest: run command `git commit -m "conventional commit message" --signoff`(.venv) sxp@pc ~/c/test (main) [0|1]> git logfatal: your current branch 'main' does not have any commits yet
Activity
shenxianpeng commentedon Jul 6, 2025
Thanks for reporting the issue. It should be fixed in v0.9.8. Please feel free to reopen if the issue persists.
jplu commentedon Jul 9, 2025
Thanks! Seems good except for some of the commands:
check-branch,check-author-emailandcheck-commit-signoffThe signoff and email commands both fails with this error:
shenxianpeng commentedon Jul 9, 2025
For
check-commit-signoffchook, it looks to work as expected.BUT it should be not failed instead of skip this hook