7

Does anyone know of a script that can accept a raw diff file and pretty print HTML output (which would be easier to review/mail)? A google search returned me some results like http://kafka.fr.free.fr/diff2html/

However all of these scripts require two files as input (they don't even accept two directories). My diff output is the diff between two svn branches

qwerty
  • 3,801
  • 2
  • 28
  • 43

6 Answers6

6

I finally used diff2html.py to create static html output of a side-by-side diff, given my unified diff intput

miken32
  • 42,008
  • 16
  • 111
  • 154
qwerty
  • 3,801
  • 2
  • 28
  • 43
4

You might be interested to cdiff, a term based tool to display side by side, incremental, and colorful diff, the design is exactly to take unified diff from stdin or revision controlled workspace.

You can just send raw diff for review if your peer is using cdiff too.

PS: I am the author of coderev and cdiff, I know cdiff is better in both design and quality :)

ymattw
  • 1,129
  • 10
  • 7
3

I've just found coderev. This might worth a try...

István
  • 518
  • 1
  • 5
  • 17
  • I recently used coderev and found it very easy to use. The html output gave many different view options for the diffs. Check out the demo site that the dev has put up. – Abhisek Sanyal Feb 04 '13 at 18:19
2

I would try a syntax highlighter, e.g. pygments handles diffs just fine.

Benjamin Bannier
  • 55,163
  • 11
  • 60
  • 80
1

The best option for me is aha (Ansi HTML Adapter - https://github.com/theZiz/aha)

$ svn diff | colordiff | aha > /tmp/diff.html
rpet
  • 156
  • 1
  • 6
0

With the evolution of diff and the existence of "aha", it's pretty simple now.

diff -y --color=always input1.tsv input2.tsv | aha --black > output.html

I also found this on https://unix.stackexchange.com/a/45390/378998

Lon Kaut
  • 2,488
  • 2
  • 11
  • 8