how do i read the commit message in pre-commit hook #1171
Answered
by
dbowling
pawandeore
asked this question in
Q&A
-
hi i want to check commit message with regex pattern but the problem is ` #!/usr/bin/env sh message="$(cat $1)" echo "MSG".$message ` |
Beta Was this translation helpful? Give feedback.
Answered by
dbowling
Jul 28, 2022
Replies: 1 comment
-
The pre-commit hook doesn't have access to the commit message. You'll need to use the commit-msg hook to have access to the path that the temp file is saved in with the message, then you can read it. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pawandeore
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The pre-commit hook doesn't have access to the commit message. You'll need to use the commit-msg hook to have access to the path that the temp file is saved in with the message, then you can read it.