Hi!
For some hooks (for example commit-msg), git will call the hook with the path to the file containing the commit message (almost always .git/COMMIT_EDITMSG). From man githooks:
commit-msg
This hook is invoked by git commit, and can be bypassed with the --no-verify option.
It takes a single parameter, the name of the file that holds the proposed commit log message.
However, the hooks4git wrappers discard these parameters:
$ cat .git/hooks/commit-msg
#!/bin/bash
if [ -x "$(command -v hooks4git)" ]; then
hooks4git -t $(basename $0)
fi
Is there a reason that hooks4git cannot pass these parameters on to the hooks? I tried adding "$@" to the end of the hooks4git command but that obviously didn't work out of the box :)
Thanks!
Hi!
For some hooks (for example commit-msg), git will call the hook with the path to the file containing the commit message (almost always
.git/COMMIT_EDITMSG). Fromman githooks:However, the hooks4git wrappers discard these parameters:
Is there a reason that hooks4git cannot pass these parameters on to the hooks? I tried adding
"$@"to the end of the hooks4git command but that obviously didn't work out of the box :)Thanks!