When the hook run the following command
(git diff --name-only HEAD~ HEAD 2>/dev/null || git diff-tree -r --no-commit-id --name-only --root HEAD) | grep -P '^(Gemfile|Gemfile.lock|.*.gemspec|package.json|npm-shrinkwrap.json)$'
I've got the following error
usage: grep [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
It seems that the default grep installed in mountain lion doesn't like the -P command
Replacing by -E seems to do the trick.
Looks odd, your error message clearly mentions the -P option in "usage"...
We'll check this though, thanks for reporting it.
Yes I know, it seems to be a bug in grep usage help of mountain lion, but Apple switched version of grep and doesn't provide -P option anymore:
Drop Perl regexp style for compatibility
* closes #1