Skip to content

Instantly share code, notes, and snippets.

@itsterry
itsterry / pre-commit.rb
Created October 1, 2015 22:59 — forked from vindia/pre-commit.rb
Git pre-commit hook to block committing Spec files with :focus => true on test blocks and .orig files from merge conflicts
#!/usr/bin/env ruby
orig_hits = []
spec_hits = []
# In Mountion Lion Apple uses BSD grep with REG_ENHANCED enabled,
# so all regular regex special chars like ?, | and + need to be
# escaped...
def grep_focus
if `grep --v`.match /BSD/