Skip to content

Instantly share code, notes, and snippets.

View jonathan1055's full-sized avatar

Jonathan Smith jonathan1055

View GitHub Profile
@benjifisher
benjifisher / find_commit.php
Created November 6, 2013 14:44
This php command-line script will do a binary search to find the first git commit that breaks your patch. It will give simple usage instructions if you invoke it without arguments. I wrote this script to help in re-rolling patches for Drupal. I posted the original version as a comment on https://drupal.org/patch/reroll . The script makes a reaso…
#!/usr/bin/env php
<?php
// Get the arguments. If there are not two, then print usage info.
if (count($argv) != 3) {
$scriptname = basename($argv[0]);
print("Usage: $scriptname <date> <patchfile>" . PHP_EOL);
print('where <date> is any date understood by git' . PHP_EOL);
print('and <patchfile> applied cleanly on <date>, not today.' . PHP_EOL);
print("Example: $scriptname 2013/05/17 foo.patch" . PHP_EOL);