Skip to content

Instantly share code, notes, and snippets.

View prateeksachan's full-sized avatar
🖖

Prateek Sachan prateeksachan

🖖
View GitHub Profile
@prateeksachan
prateeksachan / pre-commit
Created January 13, 2017 05:31 — forked from chelmertz/pre-commit
pre-commit hook for git, running php lint
#!/usr/bin/php
<?php
// copied from http://phpadvent.org/2008/dont-commit-that-error-by-travis-swicegood
// authored by Travis Swicegood
$output = array();
$return = 0;
exec('git rev-parse --verify HEAD 2> /dev/null', $output, $return);
$against = $return == 0 ? 'HEAD' : '4b825dc642cb6eb9a060e54bf8d69288fbee4904';