I was inspired by William Orr’s svn commit hook and looked up the magic needed to flesh out the git pre-commit hook I submitted to the Design Center a while back.

Now the index is checked out to its own temporary directory and cf-promises validates promises.cf and failsafe.cf before allowing the commit to proceed. Now you won’t get syntax errors if you have forgotten to add a new policy file to the index but its already included in your body common control inputs list. If your using a generated inputs list then you might want to add a separate file that includes everything for syntax checks. Be sure to include that file in the checkfiles list.

I would like to see a pre-receive version of this some day.