TortoiseSVN:好的“补丁文件”;观众?

发布于 2024-09-02 11:17:18 字数 206 浏览 5 评论 0原文

默认的补丁文件查看器很混乱(即没有并排差异视图等)。我尝试在“设置->统一差异查看器->自定义”中设置 BeyondCompare exe 的路径,但 Beyond Compare 的行为也与默认差异工具相同。 有没有办法至少允许补丁文件中并排比较?如果可以的话,方法是什么? 我的目标是允许通过电子邮件发送更改,以便在我提交更改之前可以对其进行审核:)

Mishal

The default patch file viewer is messy (ie. no side by side diff view etc). I tried setting the path of beyondCompare exe in "Settings->Unified Diff Viewer->custom", but beyond compare also behaves same as default diff tool.
Is there a way to atleast allow side by side diff in patch files ? If so, what is the method ?
My aim is to allow emailing of changes so that they can be reviewed before I commit them :)

Mishal

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

玩心态 2024-09-09 11:17:18

我从未找到过任何解决方案,但我通常使用的解决方案是简单地将补丁文件应用于树的原始签出,然后执行“常规”差异(我首选的工具是 diffuse) 来查看上下文中的更改。

“原始”补丁文件的问题在于它们仅提供更改前后的几行上下文,这通常是不够的。

如果您不喜欢该补丁,只需恢复更改并且不要提交!

I've never found any, but the solution that I usually use is to simply apply the patch file to a pristine checkout of the tree, and then do a "regular" diff (my preferred tool is diffuse) to review the changes in context.

The problem with "raw" patch files is that they only provide a few lines of context before and after the change, which often isn't enough.

If you don't like the patch, simply revert the changes and don't commit!

晚雾 2024-09-09 11:17:18

Beyond Compare 4允许您查看SVN创建的补丁文件。 Beyond Compare 的顶部窗口是一个树形结构,允许您按名称导航文件夹和文件。修订号显示在左右差异窗口中。

创建补丁

svn diff -r 5922:6116 > CodeReview.patch

在 Beyond Compare 4 中打开补丁

< img src="https://i.sstatic.net/5sfdx.png" alt="在 Beyond Compare 4 中打开补丁">

Beyond Compare 4 allows you to view patch files created by SVN. The top window in Beyond Compare is a tree structure, allowing you to navigate folders and files by name. Revision numbers are present in the left and right diff windows.

Create the patch

svn diff -r 5922:6116 > CodeReview.patch

Open the patch in Beyond Compare 4

Opening the patch in Beyond Compare 4

南街九尾狐 2024-09-09 11:17:18

我认为 SVN 1.7 自从这个答案发布以来就已经发布了,我登陆这里是因为我想用语法着色来展示我新创建的补丁文件,这是 TortoiseSvn 中的一个视图统一差异。

事实证明,如果我给文件类型指定“补丁”,Notepad++ 会自动正确地对我的文件进行语法着色!

补丁已经存在很长时间了,但 SVN 现在更全面地支持它们。
例如,请参阅文档;
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug -patch.html

有关如何创建补丁文件,请参阅这个很好的文档,其中描述了各种方法,包括我的 WinMerge;
http://docs.moodle.org/dev/How_to_create_a_patch#Creating_a_patch_using_WinMerge

SVN 1.7 I think was released since this answer was posted, and I landed here because I wanted to show my newly created patch file with syntax coloring, a la view unified diff in TortoiseSvn.

It turns out that Notepad++ automatically syntax colors my file correctly if I give it the filetype of "patch"!

Patches have been around a long time but SVN is now supporting them more fully.
See for example the documentation;
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html

For how to create a patch file, see this nice document that describes various methods including mine, WinMerge;
http://docs.moodle.org/dev/How_to_create_a_patch#Creating_a_patch_using_WinMerge

源来凯始玺欢你 2024-09-09 11:17:18

如果您可以访问 Mac OS X 计算机,PatchViewer 听起来可能可以满足您的需求:
http://appledeveloper.com.au/products/patchviewer/

(免责声明:我是PatchViewer 的作者。)

If you have access to a Mac OS X machine, PatchViewer sounds like it might do what you're looking for:
http://appledeveloper.com.au/products/patchviewer/

(Disclaimer: I am the author of PatchViewer.)

小镇女孩 2024-09-09 11:17:18

您可以在 KDE 环境中使用 Kompare 查看 diff 文件(由 diff 工具生成的补丁)。我之前在Linux上使用过它,但今天我找到了如何在Windows上安装它。以下是来自博客“Kompare - M$Windows 唯一有价值的差异”的安装说明:

  1. 转到 gnuwin32 diffutils,下载并安装。
  2. 下载 kdewin 安装程序 并启动它。
  3. 安装 kde4win 后 - 启动 kompare 并在“Diff”部分向他显示 diff.exe(来自 gnuwin32 diffutils)所在的位置。
  4. 重新启动 Kompare 即可使用!

您还可以添加与 .diff 文件格式的关联,现在您可以查看任何 diff 文件。对我来说效果很好。

You can view a diff file (a patch generated by diff tool) using Kompare from KDE environment. I used it before on Linux, but today I found how to install it on Windows. Here is an installation instruction from a blog "Kompare - the only valuable diff for M$Windows":

  1. Go to gnuwin32 diffutils, download and install.
  2. Download kdewin installer and launch it.
  3. After installing kde4win - start kompare and in "Diff" section show him where your diff.exe (from gnuwin32 diffutils) is located.
  4. Restart Kompare and it's ready to use!

You can also add an association with .diff file format and now you can view any diff files. For me it works great.

是伱的 2024-09-09 11:17:18

我喜欢使用KDiff3,它功能齐全,非常用户友好,并且适用于所有流行平台。它还可以与 TortoiseSVN 集成。

I like to use KDiff3, it's packed with functions, very user friendly and available for all popular platforms. It can also integrate with TortoiseSVN.

蓝色星空 2024-09-09 11:17:18

GitExtensions,我最喜欢的 Git GUI,也有一个选项“查看补丁文件":

“在此处输入图像描述"

GitExtensions, my favorite Git GUI, also has an option to "View patch file":

enter image description here

单挑你×的.吻 2024-09-09 11:17:18

我今天也有和你一样的疑问。我想并排审查一个补丁文件,并带有一些突出显示/颜色提示和一个相当方便的界面。经过一番搜索,我发现了这个小仓库:https://github.com/megatops/PatchViewer

它是一个 HTML 文件,可让您加载补丁文件并将其并排显示。正是我一直在寻找的

I had the same question as you today. I wanted to review a patch file side by side with some highlight/color cues and a reasonably convenient interface. After some searching, I found this little repo: https://github.com/megatops/PatchViewer.

It's a single HTML filethat lets you load a patch file, and displays it side by side. Just what I was looking for

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文