如何可视化或格式化diff /补丁文件? [英] How to visualize or format a diff / patch file?

查看:214
本文介绍了如何可视化或格式化diff /补丁文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个补丁文件(统一差异),如 svn diff git diff 的输出 diff -u ... 。我想审查它,但统一的差异格式 - 尤其是与许多文件和放大器。更改 - 很难在我的眼睛。

如何从补丁文件得到一个很好的格式化差异视图?我没有文件本身,只有差异,所以我不能使用所有常规的差异工具。



到目前为止,我的2最好的战术是: p>


  1. 在gvim中加载diff并获得一些语法突出显示

  2. 将diff粘贴到Trac wiki中#!diff -formatted部分,然后点击预览 - 这将创建一个真棒差异视图:



 {{{
#!diff
< unified diff here>
}}}

有桌面工具可以做到吗?有没有办法说服kdiff3 / diffmerge / p4merge /等来可视化的补丁文件?一些复制Trac的可视化效果也会很好。



编辑:Windows支持的额外优势,最好是安装程序或无痛苦安装。

解决方案

尝试使用kompare - http://www.caffeinated.me.uk/kompare/ 。它应该做的工作。



编辑:另外,在这里检查文件比较工具列表:I have a patch file (unified diff), like the output from svn diff, git diff, or diff -u .... I want to review it, but the unified diff format - especially with many files & changes - is hard on my eyes.

How can I get a nicely-formatted diff view from the patch file? I don't have the files themselves, only the diff, so I can't use all the regular diff tools.

So far my 2 best tactics are:

  1. Load the diff in gvim and get some syntax highlighting
  2. Paste the diff into a Trac wiki in a #!diff-formatted section and click "preview" - this creates an awesome diff view:

{{{
#!diff
<unified diff here>
}}}

Are there desktop tools that can do this? Is there a way to persuade kdiff3 / diffmerge / p4merge / etc. to visualize the patch file? Something that replicates Trac's visualization would be great as well.

EDIT: bonus points for Windows support as well, preferably with an installer or a pain-free installation.

解决方案

Try using kompare - http://www.caffeinated.me.uk/kompare/. It should do the job.

EDIT: Also, check out the list of file comparison tools here: http://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools - have a look at the column "Patch preview" in one of the tables.

这篇关于如何可视化或格式化diff /补丁文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆