QLPrettyPatch is a QuickLook generator for patch files.
Once installed, you can select patch file attachments in an email or patch files in Finder, hit spacebar and get a colorized/prettified representation of the patch.
From the Terminal, you can also run qlmanage -p /path/to/my.patch to open the patch in a QuickLook preview pane.
There are two options for installation:
- To install a pre-built copy, head to the Releases page and download the latest
QLPrettyPatch.qlgenerator.zipfile. Unzip the archive, and copyQLPrettyPatch.qlgeneratorto~/Library/QuickLook/. - To build your own copy, clone the project, open
QLPrettyPatch.xcprojin Xcode and build theInstalltarget. The build product will automatically be copied to~/Library/QuickLook/QLPrettyPatch.qlgeneator.
QLPrettyPatch uses the incredibly useful PrettyPatch formatter, which is used by the patch review system on bugs.webkit.org.
If you find yourself sending emails with patch attachments and want to include a prettified version of the patch in the email body, you should take a look at my atnan/purdypatch command line tool. It uses the same underlying formatter as this QuickLook generator.