Created
August 9, 2013 22:04
-
-
Save trshafer/6197684 to your computer and use it in GitHub Desktop.
Revisions
-
trshafer created this gist
Aug 9, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/usr/bin/env ruby # do not check in code with <<<<< nor debugger diff_contents = `git diff --cached --unified=0 --diff-filter=AM -z HEAD` bad_commit_text = diff_contents =~ /^\+(<{3,}|(\s*|.*;\s*)debugger)/ abort "Aborting: Found debugger or <<< in commit diff." if bad_commit_text # looks for text in reminders.txt reminder_location = 'ignored/reminders.txt' file_location = File.join( File.dirname(__FILE__), '..', '..', reminder_location) if File.exists?(file_location) && IO.readlines(file_location).join('').strip != '' abort "Aborting: reminders.txt not satisfied." end