A new release of wiggle

24 March 2010, 06:46 UTC

A long time ago, while in a job far far away....

Back in 2003 I wrote a program called "wiggle". Like many interesting projects it was written to scratch an itch.

While developing code for the Linux kernel I would often need to apply patches made for earlier versions against later versions. Sometimes there would be trivial conflicts and the "patch" program would just give up an create a reject file. After the 50th time that I applied a patch like this by hand it decided that enough was enough so I wrote "wiggle". It takes patches that don't quite apply properly and wiggles them in to place. If there is a change in part of the code that the patch doesn't actually change, wiggle doesn't let that get in the way. If there is a change in part of the code that the patch also changes, wiggle reports that inline as a conflict in a way that makes it easy to resolve by hand.

Since 2003 I have made a few improvements and fixed a few bugs. Just recently the Debian package of wiggle got a new maintainer who was very proactive in trying to get some patches upstream to me, and get some languishing bugs fixed.

Always keen to reward such friendly behaviour I applied the patches, fixed the bugs and finally made a new release of wiggle, the first in nearly 7 years.

Version 0.7 can be found in my git tree at git://neil.brown.name/wiggle or browsers at http://neil.brown.name/git?p=wiggle;a=summary or downloaded as a 'tar' archive from http://neil.brown.name/wiggle.

Feedback always welcome.

What I really want to know is how to get git to always use wiggle for merging conflicts. I can do it on a per-repository basis by setting the 'merge' attribute (I think) but I cannot make it automatically apply to all of my git trees...


Comments...

Another new release of wiggle (24 March 2010, 09:33 UTC)

I was a bit hasty with that release - the openSUSE package had some patches that I needed to include (rewritten somewhat). So 0.8 is now available.

[permalink][hide]

Re: A new release of wiggle (30 March 2011, 01:58 UTC)

Under OSX Snow Leopard this doesn't seem to build:

[bolt:~/downloads/wiggle_0.8] $ make install cc -ggdb -Wall -Werror -c -o load.o load.c load.c:41:20: error: malloc.h: No such file or directory cc1: warnings being treated as errors load.c: In function ‘join_streams’: load.c:55: warning: implicit declaration of function ‘realloc’ load.c:55: warning: assignment makes pointer from integer without a cast load.c: In function ‘load_regular’: load.c:76: warning: implicit declaration of function ‘malloc’ load.c:76: warning: incompatible implicit declaration of built-in function ‘malloc’ load.c:79: warning: implicit declaration of function ‘free’ load.c: In function ‘load_other’: load.c:93: warning: incompatible implicit declaration of built-in function ‘malloc’ make: *** [load.o] Error 1 [bolt:~/downloads/wiggle_0.8] $

Thanks, Jason Harris

[permalink][hide]

Re: A new release of wiggle (30 March 2011, 05:52 UTC)

It appears that malloc/free/realloc are not declared in <malloc.h> in OS/X. Can you find out which include file does define them? Maybe just "man malloc" and it might tell you. Otherwise you might need to hunt around.


[permalink][hide]

Re: A new release of wiggle (30 March 2011, 06:12 UTC)

Ahh malloc is defined in stdlib.h. So if I take out the

#include <malloc.h>

and replace this with

#include <stdlib.h>

if its not already included then this now compiles. However it prints out a whole lot of testing stuff and then concludes with:

... ./simple/multiple-add/merge FAILED /usr/bin/time: illegal option -- o usage: time [_lp] command. --- wmerge 2003-05-01 05:22:51.000000000 +0200 +++ - 2011-03-30 08:09:21.000000000 +0200 @@ -1,9 +0,0 @@ -This -is -the -current -version -of -the -file<<<---.|||=== that has changed--->>> - ./simple/multiple-add/wmerge FAILED /usr/bin/time: illegal option -- o usage: time [_lp] command. --- merge 2010-03-24 07:31:12.000000000 +0100 +++ - 2011-03-30 08:09:21.000000000 +0200 @@ -1,9 +0,0 @@ -<<<<<<< -c -||||||| -*** 1,1 **** 1 -a -======= -*** 1,1 **** 1 -b ->>>>>>> ./simple/trivial-conflict/merge FAILED 0 succeeded and 58 failed make: *** [test] Error 1 [bolt:~/downloads/wiggle_0.8]

So it looks like ever single test failed...

[permalink][hide]

Re: A new release of wiggle (30 March 2011, 06:27 UTC)

It looks like I don't need malloc.h on Linux if I have stdlib.h, so I'll make that change.

The other errors are because the OS/X version of 'time' doesn't have the '-o' option that Linux does.

If you change "/usr/bin/time -o .time" in "dotest" to "/usr/bin/time 2> .time", it might work, but if OS/X doesn't understand the "-f" arg either you will need more serious surgery.

NeilBrown

[permalink][hide]

Re: A new release of wiggle (30 March 2011, 09:03 UTC)

Yep... OSX doesn't have the -f option. I am now getting:

./simple/multiple-add/merge FAILED /usr/bin/time: illegal option -- f usage: time [_lp] command. --- wmerge 2003-05-01 05:22:51.000000000 +0200 +++ - 2011-03-30 08:36:22.000000000 +0200 @@ -1,9 +0,0 @@ -This -is -the -current -version -of -the -file<<<---.|||=== that has changed--->>> - ./simple/multiple-add/wmerge FAILED /usr/bin/time: illegal option -- f usage: time [_lp] command. --- merge 2010-03-24 07:31:12.000000000 +0100 +++ - 2011-03-30 08:36:22.000000000 +0200 @@ -1,9 +0,0 @@ -<<<<<<< -c -||||||| -*** 1,1 **** 1 -a -======= -*** 1,1 **** 1 -b ->>>>>>> ./simple/trivial-conflict/merge FAILED /usr/bin/time: illegal option -- f usage: time [_lp] command. 0 succeeded and 58 failed make: *** [test] Error 1 [bolt:~/downloads/wiggle_0.8]

[permalink][hide]




[æ]