Martin Pool's blog

Wiggle

Wiggle, a cool tool from NeilBrown:

Wiggle is a program for applying patches that 'patch' cannot apply due to conflicting changes in the original.

Wiggle will always apply all changes in the patch to the original. If it cannot find a way to cleanly apply a patch, it inserts it in the original in a manner similar to 'merge', and report an unresolvable conflict. Such a conflict will look like:

<<<<<<<
Some text from
the original file
|||||||
Some text that the patch changes
=======
Some text that is the result of the patch
>>>>>>>

with the meaning that the "text that the patch changes" was expected somewhere in the "text from the original file" and should be replaced with "the result of the patch".

wiggle analyses the file and the patch in terms of words rather than whole lines and so is able to find matches that patch is unable to find. If a patch changes a word at the end of a line, and a word at the start of that line has been modified since the patch was made, then wiggle will have no trouble applying the patch.

wiggle has proved very useful for back-porting patches that were generated for the development kernel, onto the stable kernel. Sometimes it does exactly the right thing with the patch. When it doesn't it reports a conflict which is easy to resolve with an understanding of what the code and the patch were trying to achieve.

(Mentioned on the arch-users list.)

Archives 2008: Apr Feb 2007: Jul May Feb Jan 2006: Dec Nov Oct Sep Aug Jul Jun Jan 2005: Sep Aug Jul Jun May Apr Mar Feb Jan 2004: Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan 2003: Dec Nov Oct Sep Aug Jul Jun May