Git hook to detect file changes that contain a certain string
===

I want to warn a user if their code includes a certain string and alert certain people via email.

Right now I'm using a post-receive hook because the detection needs to be done on the server side.

Right now I am updating a server-side repository and running something like `git diff-tree -r --name-only --no-commit-id $2 | xargs grep foo` to detect bad string "foo," but my hook seems to be dying silently.  I'm not sure why.  Is there a better way to do this?