Git fuzzy patch compare

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at
Fri Feb 19 10:41:14 EST 2010

On 19.02.2010 00:27, martin f krafft wrote:
> also sprach Mauro Carvalho Chehab <mchehab at> [2010.02.11.1444 +1300]:
>> If you rename a file and change some lines, or if you do a major change 
>> in a file, git has an algorithm to autodetect it.
>> For example:
>>  1 files changed, 126 insertions(+), 85 deletions(-)
>>  rewrite (75%)
> I am not sure the percentage indicates overlap in the way we would
> be able to use it to automatically supersede patches, but I also
> just didn't really understand the source code (I think it's in
> diff.c).

Having the similarity percentage available on each patch page inside
patchwork would be a nice way to look for related patches. It makes
adding each new patch an O(n) operation, and rebuilding the whole
database is O(n^2) (with a naive approach), so it might be unwieldy for
larger patchwork instances.
Speaking with my flashrom maintainer hat on, even a list of other
patches touching the same files would be pretty helpful.

Side note: A patch search functionality (i.e. search inside patches for
filenames or identifiers, then list the patch IDs) would be awesome, but
it may be totally out of scope for patchwork.


"I do consider assignment statements and pointer variables to be among
computer science's most valuable treasures."
-- Donald E. Knuth

More information about the Patchwork mailing list