Patch (Unix)



         


Unix computer program that applies textual difference between two programs and, more often, computer file or files containing such a difference, or diff files. The patch is typically an update meant to fix technical glitches like bugs or improving the usability or the performance of the previous version of an application.

The original patch program was written by Larry Wall, who is also an author of a popular programming language Perl. The program is capable of applying various formats of diffs and has become quite popular among developers who frequently exchange a small change in programs with fellow programmers. Patch has become especially popular within the free software community as it allows uninitiated developers to contribute to a project. Most open source projects are hosted on a public versioning system server from which everyone can download the source code. But for obvious security reasons, only the developers of the project can be trusted with write access. Patch makes it possible for developers that do not have write access to develop the code on their own, make a patch out of it and send it to the main developers.

To apply a patch distributed as a path to the files in question. Patches are often made so that the basedirectory of the source code tree is included in the diff-file, but you patch them from within the basedirectory of the source code tree and therefore has to use '-p1'.

You can also undo the application of a patch with:

$ patch -p1 -R < name_of_patch.diff
[Top]

Ports of patch

Patch has been ported to Cygwin, MinGW and native Windows.

See also: diff






  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License