Skip to content

Instantly share code, notes, and snippets.

@Peeja
Created September 22, 2008 18:15
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 Peeja/12083 to your computer and use it in GitHub Desktop.
Save Peeja/12083 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby -wKU
# Don't allow user to commit code containing the symbol "NOCOMMIT".
if system "git diff --cached | grep -q '^\+.*NOCOMMIT'"
puts "Can't commit: NOCOMMITs found in code."
system "git grep --cached -n NOCOMMIT"
exit 1
else
exit 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment