二维比较是SCM功能吗?
我们有一维和二维差异工具。但是我们也有这两种风格的 VCS 吗? SVN 是一维的,而现代 SCM 是二维的,这样说对吗?
We have uni- and bi-dimensional diff tools. But we have those two flavors also for VCSes?
Is it correct to say that SVN is unidimensional and modern SCMs are bidimensional?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SCM 主要使用所谓的一维差异。例如,Git 可以生成逐字差异(具有“单词”是什么的可配置概念),但重点是人类可读性,这不是默认行为。特别是,如果您想生成要应用于其他地方的补丁,您将使用逐行(一维)差异。据我所知,当前所有常见的 SCM 都是如此 - 有些甚至可能不提供二维(字差异)功能。
SCMs primarily use what you call unidimensional diffs. Git, for example, can produce word-by-word diffs (with configurable notions of what "words" are), but the focus is on human readability, and it's not the default behavior. In particular, if you want to generate patches to be applied elsewhere, you'll use line-by-line (unidimensional) diffs. As far as I know, this is true of all of the common current SCMs - and some may not even provide the bidimensional (word diff) capability.
我猜你说的是 2/3 路差异。
这不是版本控制系统处理差异的责任,而是您使用它的 (G)UI 的责任。
当 SVN 中发生冲突时,您的工作副本中有 3 个不同的文件:您的原始文件、即将发布的版本和基本通用版本。
例如,Subclipse(SVN Frontend for Eclipse)提供了基于这三个文件的三向比较,以帮助您解决冲突。
I suppose you are talking about 2/3-way diffs.
This is not the reponsability of the version control system to process diffs, but the (G)UI you use for it.
When a conflict occurs in SVN, you have 3 different files in your working copy : Your original file, the upcomming version and the base common version.
For instance, Subclipse (SVN Frontend for Eclipse) provides a 3-way comparison based on these 3 files, to help you resolve conflicts.