'Git format-patch viewer?

Somebody is sending me patches generated by "git format-patch".

Is there a gui (on linux) that can open these .patch files?

I've tried many diff gui but all they do is compare two existing files/folders. None can display the patch, except kompare which spits a "The diff is malformed. Some lines could not be parsed and will not be displayed in the diff view." everytime.

git


Solution 1:[1]

I've made a tool to view diff side-by-side: https://app.box.com/s/l8rmp281aptq711fqwve

Screenshot: enter image description here

Now it was updated to v0.4 to support file list.

Source code: https://github.com/megatops/PatchViewer

Solution 2:[2]

I found a solution:

cat patch | colordiff | less -RS

Further reading: http://www.markusbe.com/2009/12/how-to-read-a-patch-or-diff-and-understand-its-structure-to-apply-it-manually/ (archived copy)

Solution 3:[3]

The .diff and .patch files that git generates are just plain-text diff files.

Most text editors on linux should be able to open and syntax-highlight the diff files. Emacs and vim should be able to view them without any problem, as should gedit, kate, or pretty much any other syntax-highlighting text editor.

If you don't need syntax highlighting, less, cat, or anything else that displays plain text should also show you the changes.

Solution 4:[4]

Git Cola includes an "Apply Patches" dialog that can be launched from the Actions menu, or via the git cola am sub-command. You can open patches in this dialog and display the contents with diff syntax highlighting.

This feature is available in master by cloning the repo and will be in the upcoming v3.3 release.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 ruffin
Solution 3 Justin Weiss
Solution 4 davvid