Skip to content

Instantly share code, notes, and snippets.

@freegenie
Created May 15, 2012 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freegenie/2704627 to your computer and use it in GitHub Desktop.
Save freegenie/2704627 to your computer and use it in GitHub Desktop.
pre-commit hook to avoid commit of :focus
#!/bin/bash
#
# pre-commit hook, avoid committing :focus on rspec examples
focus=', :focus'
result=$(git grep -n $focus -- */**/*_spec.rb)
if [ "$result" != '' ]; then
echo ""
echo "Refusing to commit a :focus tag in specs: "
echo ""
echo $result
echo ""
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment