Skip to content

Instantly share code, notes, and snippets.

{"url": "/api/foo", "method": "GET", "duration": 1.234}
{"url": "/api/bar", "method": "POST", "duration": 5.678}
{"url": "/api/bar", "method": "POST", "duration": 4.222}
@Simbul
Simbul / pre-commit
Created February 9, 2012 18:06
Git hook to prevent commits on a staging/production branch
#!/usr/bin/env ruby
# This pre-commit hook will prevent any commit to forbidden branches
# (by default, "staging" and "production").
# Put this file in your local repo, in the .git/hooks folder
# and make sure it is executable.
# The name of the file *must* be "pre-commit" for Git to pick it up.
FORBIDDEN_BRANCHES = ["staging", "production"]