RE: Patch files for Contributions?

airblaster <[email protected]> 20 Jul 2003 10:34:38 -0000
Newsgroups gmane.comp.web.oscommerce.suggestions
Message-ID <a74d0a6d0ddeacd985245c9e59a56dda@osCommerce-Forums>
This message was sent from: Suggestions and Proposals
http://forums.oscommerce.com/viewtopic.php?p=199205#199205
----------------------------------------------------------------

guess its better to divide my answer into two parts...:

[b]1.) Technical Problems [/b](since I don't know what you know already I'll just write everything that could be important)

[b][list]The Programs needed to use patch:[/list][/b]
Almost every system has got the programs needed for free.
On Linux like Systems they are usually installed or can easily be installed from CD/DVD.
On Windows you don't need to install a complete development environment because there is already an rather easy to install package that includes everything thats neacessary: http://unxutils.sourceforge.net.
Another way that would be even more convenient in daily use would be making the patches out of CVS, but thats harder install and learn.

[b][list]Making a patch:[/list][/b]
It isn't that much to do if you do one thing at a time. If you do it without CVS you just keep a copy of your old code and do a:
'diff -u -r -P oldcodedir newcodedir > mycontribution.diff'
There will only be one file that contains _all_ the changes, including newly created files.
(well, there might be better ways to use it, but this should work. Actually I began using diff and patch just about a week ago, so I'm quite new to this)

[b][list]Applying a patch:[/list][/b]
Even easier... open a commandline/shell at the root-directory of a catalog that hasn't this contribution (or an earlier version of it) applied and do a 'patch -p 1 --dry-run < mycontribution.diff' to test if the patch is working with you codebase. If its ok you just do a  'patch -p 1 < mycontribution.diff', if not you probeably need to change the -p 1 parameter (just take a look at 'patch --help' on how to use it)

[b]2.) Weither its a good thing or not [/b]

First off: I don't say that people should quit making contributions the way the do now. I just say it would be nice if they also could include a patch file (or additionally upload the same Version of the Code additionally in a patch file only package if the size is really that much of an problem).

I also think if someone hasn't got the time to make a patchfile its better to release his/her contribution without it. Patchfiles should definitly not be a requirement.
But an additional patchfile whenever it is possible would be great. It would allow anyone who takes 30 Minutes to install the required tools and read the manual to apply most patches within two minutes.