Convert raw diff file to colorized html output

白昼怎懂夜的黑 提交于 2019-12-30 09:48:11

问题


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


回答1:


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




回答2:


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




回答3:


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 :)




回答4:


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




回答5:


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

$ svn diff | colordiff | aha > /tmp/diff.html


来源:https://stackoverflow.com/questions/3827862/convert-raw-diff-file-to-colorized-html-output

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!