不同的版本控制工具是否更适合不同的语言?

发布于 2024-09-10 15:07:16 字数 119 浏览 5 评论 0原文

我想知道,是否有哪些特定语言(C++、Java、Python、Haskell 等)比其他语言更适合一种 VCS?也许是由于语法或其他因素?

或者选择 VCS 是否应该始终不受此类问题的影响?

I was wondering, are there any ways in which specific languages (C++, Java, Python, Haskell, etc) are especially suited more to one VCS than others? Maybe due to syntax or other factors?

Or should choosing a VCS always be unaffected by such concerns?

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

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

发布评论

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

评论(4

一身骄傲 2024-09-17 15:07:16

我所知道的所有 VCS 都与内容无关,您可以存储二进制或文本 (ASCII/UTF-8) 文件。选择 VCS 的一个可能因素是开发操作系统支持(例如:git 对 Windows 的支持很差)和 IDE 集成,这可能是特定于语言的。

至于VCS是否应该不受这些担忧的影响,我确实这么认为。同时它应该足够灵活,可以让其他工具执行语言和项目特定的操作(大多数 VCS 通过钩子来完成此操作)。

All VCS' I know are content agnostic, you can store binary or text (ASCII/UTF-8) files. One possible factor for choosing a VCS is development OS support (example: git has bad windows support) and IDE integration, which may be language-specific.

As to whether a VCS should be unaffected by such concerns, I truly believe so. At the same time it should be flexible enough to let other tools do language and project specific things (most VCS do this through hooks).

后eg是否自 2024-09-17 15:07:16

您放入 VCS 中的内容可能会影响以下方面:

  • 存储:对于简单文本、Microsoft Word 文档、UML 模型(Rational .rose 文件)、html 页面,增量的存储方式可能有所不同, ...
    例如,请参阅 ClearCase 类型管理器 作为 VCS 基于元素内容管理存储的示例。

  • 合并:可以根据版本化文件的内容通过以下方式进行不同的合并:

    • 内部算法(如果 VCS 有类型管理器)
    • 外部第三方合并工具,可以根据文件的扩展名和内容推断一些“智能”合并策略。

关于您的问题,据我所知,版本化文件中的编程语言从来都不是存储或合并的标准:它们(文件)只是文本。
如果对它们进行不同的处理,则只有在合并过程中,并且只有外部合并工具足够智能,可以根据文件内容执行某种“智能”合并时。
但 VCS 本身通常不参与该特殊合并(对于被视为文本的源文件)。

The content you put in a VCS can matter for:

  • storage: the way the delta is stored can differ for simple texts, Microsoft Word documents, UML models (Rational .rose files), html pages, ...
    See for instance ClearCase type manager as an example of VCS managing the storage based on element content.

  • merge: merging can be done differently based on the content of the versioned files through:

    • internal algorithm (if the VCS has type manager)
    • external third-party merge tools which can infer some "intelligent" merge tactics based on the extension and content of the file.

Regarding your question, the programing language within versioned files is to my knowledge never a criteria for storing or merging: they (the files) are just text.
If they are treated differently, it would be only during the merge process, and only if an external merge tool is smart enough to perform an "intelligent" merge of some kind based on the file content.
But the VCS itself is generally not involved in that special merge (for source files considered as text).

浅唱々樱花落 2024-09-17 15:07:16

对于 VCS 而言,您放入其中的内容并不重要(您甚至可能没有代码),但您使用它的方式却很重要。大多数 IDE 可以与部分版本控制系统集成,但不是所有版本控制系统。选择一个您的 IDE 可以集成(本地或通过插件)的 VCS 将带来显着的好处。

话虽如此,如果要在没有 IDE 支持的 VCS 或根本没有 VCS 之间进行选择,请始终使用 VCS。

It doesnt matter to the VCS what you put in it, (you might not even have code in it) but the way you use it does. Most IDEs can integrate with some, but not all version control systems. Picking a VCS your IDE can integrate (either nativly or with plugins) with will provide provide a significant benefit.

With that said, if the choice is between a VCS with no IDE support or no VCS at all, always ALWAYS use VCS.

紫﹏色ふ单纯 2024-09-17 15:07:16

往往会导致源文件的平均大小不同。某些语言和编码风格往往会导致 10000 行以上的代码文件。在这种情况下,您绝对需要一个基于合并的分支工具。对于较小的代码文件,其他人在同一文件中进行不相关更改的可能性要小得多,因此主要通过锁定工作、仅偶尔进行合并的工具/策略效果很好。

The thing that tends to make a differences average size of source file. Some lanuages and coding styles tend to lead to 10000+ line code files. In that case, you absolutely need a merge-based, branching tool. With smaller code files, there is much less chance someone else will be making an unrelated change in the same file, and so a tool/policy that works mostly by locking, with only occasional merges, works well.

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