Wednesday, December 02, 2009

How to Use Patch and Diff Commands to Create and Apply Patches

How to Use Patch and Diff Commands to Create and Apply Patches | Coding && Computer Tips Blog: "The world of Unix is a place where everything is done the right way, till there is an even “righter” way to do it. For everything that gets coded, there is always something left to be edited. Almost every project in the Linux (or other unix related OS) community is based on patches. There are even quite a lot of patches for the linux kernel itself.

A patch is essentially a remedy of some kind to the original source code (or just data). Imagine, for instance, that you just discovered a critical security bug in openssh (well, you won’t be the first or the last to do that). After you fix that, you would want to inform the others (hopefully) about this bug and provide your solution. While you could still just provide the authors with your version of openssh sources, wouldn’t it be better if you just provided them with a patch, that when applied, it will automatically do the necessary changes to the needed files ?"