Some of the subtleties of placing your new patched code are not immediately obvious. Look at a program that has been multipatched and try to work out which lines are the patches is a nightmare - but if you cannot do that, how are you going to redo all your lovely patches when CliffordAdams gives us v1.00 ?
In addition there are several modes the program can run in
I have described the things I think are important (some a matter of style, some a matter of keeping the three-state program working in all three states). Feel free to disagree with my style. Feel even freer to tell me if I have overlooked anything technical.
I'd like to point out that a Unix diff is not a meaningful patch. The line numbers may be different depending on what patches have been applied. It's better to write out the entire diff by yourself, bolding each changed line, and surrounding it with enough context that any reasonably intelligent person should be able to apply it by hand. For a complex example, see /TaviStyleHistory. -- SunirShah
I agree: bold is for humans, diff is for shell scripts. In a good way, of course. -- RobertBrook
I would like to disagree, and vehemently so, with SunirShah. The patch program is pretty good at finding offsets, will tell you when chunks fail, and if it cannot succeed, will generally leave you with something that's fairly straightforward to sort out by hand. If you have a heavily patched version of UseMod, and you get more failed chunks than successful ones, it's usually not too much work to apply the patch to a separate clean copy of UseMod, and then use ediff or vimdiff to piece the bits back together manually. In any event, so doing is easier than trying to apply a SunirShah format patch, which makes even the easy case difficult (and the hard case no easier). It seems deeply unlikely that UseModWiki should need a unique (and manual!) patching system, when diff and patch suffice for projects as complex as the Linux Kernel. -- JTJM
Although a 'diff -u' is good, 'diff -c' is better because it is more universally available (I think GNU diff is [one of] the only diffs to have '-u'). Both are also readable by humans and by the 'patch' program which makes updating your wiki script much easier. -- DavidMasterson
Or describe the patch in some more exact language like Perl.
Or invent UseModWikiPlugins and avoid the entire problem...
Anyone know of a patch some thing like code ... /code I can cut/paste C/C++ code samples for discussion without wiki playing with the format ? Thanks! --NikhilK?
The <nowiki> </nowiki> tag does this, I think.
Actually, Bracket your C/C++ source code with <pre> ... </pre>. -Jeff Hare
As I recall, I had to use a combination of both <nowiki> ... </nowiki> and <pre> ... </pre> to get the wiki to leave code alone.
The correct escape for pre-formatted WikiFree text is <pre><nowiki>.