Created
December 19, 2012 08:39
-
-
Save mmenozzi/4335325 to your computer and use it in GitHub Desktop.
Simple PHP script to find out wich commit broke given test command.
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 characters
<?php | |
$sinceDate = '11/01/2012'; // Change to fit your needs | |
$testCommand = 'phpunit src/Symfony/Component/Finder'; // Change to fit your needs | |
$revlist = array(); | |
exec("git log --since=$sinceDate --branches=master --reverse --pretty=%H | cat", $revlist); | |
foreach ($revlist as $commit) { | |
echo "Checking out commit $commit...\r\n"; | |
system("git checkout $commit"); | |
echo "Running tests...\r\n"; | |
$return = null; | |
system($testCommand, $return); | |
if ($return !== 0) { | |
break; | |
} | |
} | |
echo "Blame on $commit !!!\r\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment