From: Nathan W. Panike Date: Thu, 05 May 2011 18:17:41 GMT Subject: How to efficiently find where a patch applies? Message-ID: <20110505181741.GA27251@nwp-laptop> In the past couple weeks, I have had several occasions where a collaborator has sent a patch, which does not have information about where the patch forked from master. I wrote the following scripts to try to discover where the patch should be applied. Is there a better way? create_awk.pl: ----------------------->8------------------------------------------ #! /usr/bin/env perl print <){ if(/^index ([0-9a-f]+)\.\..+$/){ $hash = $1; } else { next; } if($hash =~ /^0*$/) { next; } print "|" if($numseen > 0); $numseen = 1; ++$nummatches; print "$hash"; } print "/{ i += 1; print \$0}\n"; print <)" > /dev/null || \ echo $commit; \ done Nathan Panike