Patch “how-to”, patch files fixed

I don’t really do much Unix development, but I’ve recently been learning more due to the care and feeding of my blog. Lately I’ve been figuring out some things about the patch utility, especially creating and applying patches. I found a decent tutorial on patch and diff which are the two tools needed to apply and create (respectively) patch files. The tutorial goes into much more depth than I would ever attempt. It’s also well written, so I’ll just point people there instead of re-inventing the wheel. But I think a “diff & patch” nutshell usage would be appropriate, so here it is.

Creating a patch (individual files)
diff -u old-file new-file >patch-file

Creating a patch (whole directory/tree)
diff -urN old-directory new-directory >patch-file

Applying a patch (individual file or whole directory/tree)
patch <patch-file

While reading the article, I discovered that I had made some mistakes when I created at least one of my patchfiles, so I went through all my patch-related posts and re-created everything. I’m very glad I did! I found a whole bunch of small corrections I had made to BorderlineChaos which I’d forgotten to document and/or release in my post on Borderline Chaos’s date format. Likewise, I made many minor changes which I didn’t document in my journalized-blue post. Finally, the patch for Felix Wong’s tags plugin was definitely broken. I’ve corrected it and updated the original article.

About Jim Vanderveen

I'm a bit of a Renaissance man, with far too many hobbies for my free time! But more important than any hobby is my family. My proudest accomplishment has been raising some great kids! And somehow convincing my wife to put up with me since 1988. ;)
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

4 Responses to Patch “how-to”, patch files fixed

  1. Pingback: SonicChicken weblog » Blog Archive » Borderline Chaos not honoring date format?

  2. Pingback: SonicChicken weblog » Blog Archive » Tags support finished on J-blue

  3. Pingback: SonicChicken weblog » Blog Archive » New parameter for list_tags() cleaned up Sharepoint theme

  4. Pingback: SonicChicken weblog » Blog Archive » Samir’s ‘Steam’ theme available

Leave a Reply

Your email address will not be published. Required fields are marked *