Skip to content

Hook wrappers do not pass on hook parameters given by git #72

@chfr

Description

@chfr

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!

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions