Add blacklist to commit hook. no issue #
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 15 Oct 2014 18:25:34 +0000 (14:25 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 15 Oct 2014 18:25:34 +0000 (14:25 -0400)
git/hooks/coding-standards.sh

index 79b0cdd3cb99903648fb80c6a24c51beb86156cd..d4e4c719dfc2cbeb54f7778379c7570d15cc20ae 100755 (executable)
@@ -13,6 +13,20 @@ $oldrev  = ARGV[1]
 $newrev  = ARGV[2]
 $user    = ENV['USER']
 
+def blacklist bl
+  all_revs = `git rev-list #{$oldrev}..#{$newrev}`.split("\n")
+  all_revs.each do |rev|
+    bl.each do |b|
+      if rev == b
+        puts "Revision #{b} is blacklisted, you must remove it from your branch (possibly using git rebase) before you can push."
+        exit 1
+      end
+    end
+  end
+end
+
+blacklist ['26d74dc0524c87c5dcc0c76040ce413a4848b57a']
+
 # Only enforce policy on the master branch
 exit 0 if $refname != 'refs/heads/master'