灵活分支与静态分支(Git 与 Clearcase/Accurev)

发布于 2024-07-17 11:47:21 字数 519 浏览 8 评论 0原文

我的问题是关于 Git 处理分支的方式:每当您从提交分支时,该分支都不会收到来自父分支的更改,除非您强制进行合并。

但在其他系统中,例如 Clearcase 或 Accurev,您可以指定如何用某种继承机制填充分支:我的意思是,使用 Clearcase,使用 config_spec,您可以说“修改所有文件”在分支 /main/issue001 上,然后继续在 /main 上或使用此特定基线”。

在 Accurev 中,您也有一个类似的机制,让流接收来自上层分支的更改(流如何称呼它们),而无需在分支上合并或创建新的提交。

使用 Git 的时候你不会错过这一点吗? 您能否列举出必须继承的场景?

谢谢

更新请阅读下面的 VonC 答案,以真正集中我的问题。 一旦我们同意“线性存储”和基于 DAG 的 SCM 具有不同的功能,我的问题是:在现实生活中哪些场景(特别是对于 OSS 以外的公司)线性可以完成 DAG 无法完成的事情? 它们值得吗?

My question is about the way in which Git handles branches: whenever you branch from a commit, this branch won’t ever receive changes from the parent branch unless you force it with a merge.

But in other systems such us Clearcase or Accurev, you can specify how branches get filled with some sort of inheritance mechanism: I mean, with Clearcase, using a config_spec, you can say “get all the files modified on branch /main/issue001 and then continue with the ones on /main or with this specific baseline”.

In Accurev you also have a similar mechanism which let’s streams receive changes from upper branches (streams how they call them) without merging or creating a new commit on the branch.

Don’t you miss this while using Git? Can you enumerate scenarios where this inheritance is a must?

Thanks

Update Please read VonC answer below to actually focus my question. Once we agree "linear storage" and DAG based SCMs have different capabilities, my question is: which are the real life scenarios (especially for companies more than OSS) where linear can do things not possible for DAG? Are they worth?

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

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

发布评论

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

评论(9

寒江雪… 2024-07-24 11:47:21

要理解为什么 Git 不提供某种您所说的“继承机制”(不涉及提交),您必须首先了解 这些 SCM 的核心概念(例如 Git 与 ClearCase) )

  • ClearCase 使用线性版本存储:元素(文件或目录)的每个版本都与同一元素的先前版本以直接线性关系链接元素。

  • Git 使用DAG - 有向非循环图:文件的每个“版本”实际上是树中全局更改集的一部分,树本身也是提交的一部分。 之前的版本必须在之前的提交中找到,可以通过单个有向非循环图路径访问。

在线性系统中,配置规范可以指定几个规则来实现您所看到的“继承”(对于给定文件,首先选择某个版本,如果不存在,则选择另一个版本,如果不存在,则选择一个第三,依此类推)。

该分支是分叉,位于线性历史记录中给定选择规则的给定版本(该规则之前的所有其他选择规则仍然适用,因此具有“继承”效果)

在 DAG 中,提交代表您将获得的所有“继承”; 没有“累积”版本选择。 此图中只有一条路径可以选择您在这一点(提交)将看到的所有文件。
分支只是该图中的一条新路径。

要在 Git 中应用某些其他版本,您必须:

但是由于 Git 是基于 DAG 的 SCM,它总是会导致新的提交。

你正在“失去什么” ”与 Git 是某种“组合”(当您使用不同的连续选择规则选择不同版本时),但这在 DVCS 中不切实际(如“分布式”):如果您使用 Git 创建分支,则需要明确定义起点和内容并轻松复制到其他存储库。

在纯粹的中央 VCS 中,您可以定义工作区(在 ClearCase 中)。 ,您的“视图”,快照或动态)以及您想要的任何规则。


unknown-google 在评论中添加(以及在上面的问题中):

因此,一旦我们看到这两个模型可以实现不同的目标(线性与 DAG),我的问题是:在现实生活中哪些场景(特别是对于 OSS 以外的公司)线性可以完成 DAG 无法完成的事情? 他们值得吗?

当谈到选择规则的“现实场景”时,您可以在线性模型中做的是为同一组文件设置多个选择规则

考虑这个“配置规范”(即 ClearCase 选择规则的“配置规范”):

element /aPath/... aLabel3 -mkbranch myNewBranch
element /aPath/... aLabel2 -mkbranch myNewBranch

它选择所有标记为“aLabel2”的文件(以及从那里开始的分支),除了那些标记为“”的文件aLabel3' - 并从那里分支 - (因为该规则先于提及“aLabel2”的规则)。

这值得么?

不。

实际上,ClearCase 的 UCM 风格(“统一配置管理” ”方法包含在 ClearCase 产品中,并代表从基本 ClearCase 使用中推导出来的所有“最佳实践”)出于简单性的原因不允许这样做。 一组文件称为“组件”,如果您想针对给定标签(称为“基线”)进行分支,则将按照以下配置规范进行翻译:

element /aPath/... .../myNewBranch
element /aPath/... aLabel3 -mkbranch myNewBranch
element /aPath/... /main/0 -mkbranch myNewBranch

您必须选择一个 起点(此处为“aLabel3”)并从那里开始。
如果您还需要“aLabel2”中的文件,则需要将所有“aLabel2”文件合并到“myNewBranch”中的文件。

这是您不必使用 DAG 进行的“简化”,其中图形的每个节点都代表分支的唯一定义的“起点”,无论涉及的文件集是什么。

合并和变基足以将该起点与给定文件集的其他版本组合起来,以实现所需的“组合”,同时将特定历史记录隔离在分支中。

总体目标是推理“应用于一致组件的一致版本控制操作”。
一组“连贯”的文件是处于明确定义的连贯状态的文件:

  • 如果有标签,则其所有文件都被标记
  • ;如果有分支,其所有文件将从<相同的独特起点

这在 DAG 系统中很容易完成; 在线性系统中这可能会更加困难(特别是对于“Base ClearCase”,其中“配置规范”可能很棘手),但它是通过同一基于线性的工具的 UCM 方法来强制执行的。

您不是通过“私有选择规则技巧”(使用 ClearCase,一些选择规则顺序)来实现“组合”,而是仅通过 VCS 操作(变基或合并)来实现它,这会留下清晰的痕迹供每个人遵循(与开发人员私有的配置规范,或在一些但不是所有开发人员之间共享的配置规范)。
它再次强调了一种连贯性而不是“动态灵活性”,您以后可能很难重现这种感觉

这允许您离开 VCS(版本控制系统) 领域并进入 < a href="http://en.wikipedia.org/wiki/Software_Configuration_Management" rel="nofollow noreferrer">SCM(软件配置管理),主要关注“再现性” ”。 而这一点(SCM 功能)可以通过基于线性或基于 DAG 的 VCS 来实现。

To understand why Git does not offer some kind of what you are referring to as an "inheritance mechanism" (not involving a commit), you must first understand one of the core concepts of those SCMs (Git vs. ClearCase for instance)

  • ClearCase uses a linear version storage: each version of an element (file or directory) is linked in a direct linear relationship with the the previous version of the same element.

  • Git uses a DAG - Directed Acyclic Graph: each "version" of a file is actually part of a global set of changes in a tree that is itself part of a commit. The previous version of that must be found in a previous commit, accessible through a single directed acyclic graph path.

In a linear system, a config spec can specify several rules for achieving the "inheritance" you see (for a given file, first select a certain version, and if not present, then select another version, and if not present, then select a third, and so on).

The branch is a fork in a linear history a given version for a given select rule (all the other select rules before that one still apply, hence the "inheritance" effect)

In a DAG, a commit represents all the "inheritance" you will ever get; there is no "cumulative" selection of versions. There is only one path in this graph to select all the files you will see at this exact point (commit).
A branch is just a new path in this graph.

To apply, in Git, some other versions, you must either:

But since Git is a DAG-based SCM, it will always result in a new commit.

What you are "losing" with Git is some kind of "composition" (when you are selecting different versions with different successive select rules), but that would not be practical in a DVCS (as in "Distributed"): when you are making a branch with Git, you need to do so with a starting point and a content clearly defined and easily replicated to other repositories.

In a purely central VCS, you can define your workspace (in ClearCase, your "view", either snapshot or dynamic) with whatever rules you want.


unknown-google adds in the comment (and in his question above):

So, once we see the two models can achieve different things (linear vs DAG), my question is: which are the real life scenarios (especially for companies more than OSS) where linear can do things not possible for DAG? Are they worth it?

When it comes to "real-life scenario" in term of selection rules, what you can do in a linear model is to have several selection rules for the same set of files.

Consider this "config spec" (i.e. "configuration specification" for selection rules with ClearCase):

element /aPath/... aLabel3 -mkbranch myNewBranch
element /aPath/... aLabel2 -mkbranch myNewBranch

It selects all the files labelled 'aLabel2' (and branch from there), except for those labelled 'aLabel3' - and branch from there - (because that rule precedes the one mentioning 'aLabel2').

Is it worth it?

No.

Actually, the UCM flavor of ClearCase (the "Unified Configuration Management" methodology included with the ClearCase product, and representing all the "best practices" deduced from base ClearCase usage) does not allow it, for reasons of simplificity. A set of files is called a "component", and if you want to branch for a given label (known as a "baseline"), that would be translated like this following config spec:

element /aPath/... .../myNewBranch
element /aPath/... aLabel3 -mkbranch myNewBranch
element /aPath/... /main/0 -mkbranch myNewBranch

You have to pick one starting point (here, 'aLabel3') and go from there.
If you want also the files from 'aLabel2', you will make a merge from all the 'aLabel2' files to the ones in 'myNewBranch'.

That is a "simplification" you do not have to make with a DAG, where each node of the graph represents a uniquely defined "starting point" for a branch, whatever is the set of files involved.

Merge and rebase are enough to combine that starting point with other versions of a given set of files, in order to achieve the desired "composition", while keeping that particular history in isolation in a branch.

The general goal is to reason in "coherent Version Control operations applied to a coherent component".
A "coherent" set of files is one in a well-defined coherent state:

  • if labelled, all its files are labelled
  • if branched, all its files will branch from the same unique starting point

That is easily done in a DAG system; it can be more difficult in a linear system (especially with "Base ClearCase" where the "config spec" can be tricky), but it is enforced with the UCM methodology of that same linear-based tool.

Instead of achieving that "composition" through a "private selection rule trick" (with ClearCase, some select rule order), you achieve it only with VCS operations (rebase or merge), which leave a clear trace for everyone to follow (as opposed to a config spec private to a developer, or shared amongst some but not all developers).
Again, it enforces a senses of coherency, as opposed to a "dynamic flexibility", that you may have a hard time to reproduce later on.

That allows you to leave the realm of VCS (Version Control System) and enter the realm of SCM (Software Configuration Management), which is mainly concerned with "reproducibility". And that (SCM features) can be achieved with a linear-based or a DAG-based VCS.

許願樹丅啲祈禱 2024-07-24 11:47:21

It sounds like what you're looking for might be git rebase. Rebasing a branch conceptually detaches it from its original branch point and reattaches it at some other point. (In reality, the rebase is implemented by applying each patch of the branch in sequence to the new branch point, creating a new set of patches.) In your example, you can rebase a branch to the current tip of an upper branch, which will essentially "inherit" all the changes made to the other branch.

谁的新欢旧爱 2024-07-24 11:47:21

我不太清楚你的要求,但这听起来像是 git 的
跟踪语义就是你想要的。 当你从 am 原点分支时
你可以这样做:

git -t -b my_branch origin/master

然后未来的“git pull”将自动将 origin/master 合并到你的
工作分支机构。 然后你可以使用“gitcherry-vorigin/master”来查看
有什么区别。 您可以在发布之前使用“git rebase”
进行更改以清理历史记录,但不应使用一次 rebase
您的历史记录是公开的(即其他人正在关注该分支)。

I'm not totally clear on what your asking for but it sounds like git's
tracking semantics are what you want. When you branch from am origin
you can do something like:

git -t -b my_branch origin/master

And then future "git pull"s will auto merge origin/master into your
working branch. You can then use "git cherry -v origin/master" to see
what the difference is. You can use "git rebase" before you publish your
changes to clean up the history, but you shouldn't use rebase once
your history is public (i.e. other people are following that branch).

时光病人 2024-07-24 11:47:21

至于 Accurev 使用的继承方案:当查看 git-flow 时,GIT 用户可能会“了解”整个内容 (另请参阅:http://github.com/nvie/gitflowhttp://jeffkreeftmeijer.com/2010/why-arent-you-using -git-flow/

这个 GIT 分支模型或多或少(手动/在 git-flow 工具的帮助下)实现了 Accurev 自动开箱即用的功能,并且很棒 GUI 支持。

所以看起来 GIT 可以做 Accurev 所做的事情。 由于我从未真正日常使用过 git/git-flow ,所以我不能真正说出它是如何工作的,但它看起来确实很有希望。 (减去适当的 GUI 支持:-)

As to the inheritance scheme used by accurev: GIT users will probably "get" the whole thing when the look at git-flow (see also: http://github.com/nvie/gitflow and http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)

This GIT branching model more or less does (manually / with the help of the git-flow tool) what accurev does out-of-the-box automatically and with great GUI support.

So it appears GIT can do what accurev does. Since I never actually used git/git-flow day-to-day I can't really say how it works out but it does look promising. (Minus proper GUI support :-)

一抹淡然 2024-07-24 11:47:21

我会尽力回答你的问题。 (这里我必须说,我没有使用过GIT,只是读过它,所以如果我下面提到的内容有误,请纠正我)

“你能列举出必须继承的场景吗?”

我不会说这是必须的,因为您可以使用现有的工具解决问题,并且可能是适合您的环境的有效解决方案。 我想这更多的是流程的问题,而不是工具本身的问题。 确保您的流程是连贯的,并且还允许您及时返回以重现任何中间步骤/状态是我们的目标,而且该工具的优点是该工具可以让您尽可能轻松地运行您的流程和 SCMP

我可以的一个场景当您希望将一组更改“隔离”映射到任务( devtask、CR、SR 或任何定义更改集的目的/范围的内容)

使用此组合可以让您的开发分支变得干净,并且仍然使用其余代码的不同组合(使用组合),并且仍然具有 在任务的整个生命周期中,仅将与任务相关的内容隔离在分支中,直到集成阶段。

作为纯粹主义者,必须提交/合并/变基只是为了有一个“定义的起点”,我想这会“污染”你的分支,你最终会得到你的更改+你的分支中的其他更改/更改设置。

这种隔离何时/何地有用?
以下几点可能仅在追求 CMM 和某些 ISO 认证的公司的背景下才有意义,对于其他类型的公司或 OSS 可能没有兴趣

  • 由于非常挑剔,您可能需要准确计算代码行数 (添加/修改/删除)对应于单个开发人员的更改集,稍后用作代码和工作量估计的一个输入。

  • 仅将您的代码放在单个分支中(不与其他更改粘合),可以更轻松地在不同阶段审查代码

    仅将

在由多个团队和超过 500 名开发人员积极同时处理相同基本代码的大型项目中(其中图形化的单个元素版本树看起来像一个杂乱的网络,有多个负载线,每个负载线一个)大客户,或每种技术一个)使用多个深度组合的大型配置规范使得这么多人无缝地工作以将相同的产品/系统(基本代码)适应不同的目的。 使用此配置规范,动态地为每个团队或子团队提供他们需要的内容和需要分支的不同视图(在几种情况下级联),无需创建中间集成分支,或不断合并和重新建立所有分支您需要开始的部分。 来自同一任务/目的的代码是不同标签的分支,但有意义。 (您可以在这里争论“已知基线”作为 SCM 的原则,但书面 SCM 计划中设想的简单标签就完成了工作)
一定可以用 GIT 解决这个问题(我猜是以非动态方式),但我发现如果没有这种“继承”行为,我真的很难想象。
我猜 VonC 提到的“如果分支,它的所有文件将从相同的唯一起点分支”在这里被打破了,但除了 SCMP 上有详细记录之外,我记得这样做有很强的商业理由。

是的,构建我上面提到的这些配置规范并不是免费的,一开始有 4-5 个高薪人员在 SCM 后面,但后来通过自动脚本减少了数量,这些脚本会询问您想要什么标签/分支/功能,并将为你写CS。

这里的可重复性是通过将配置规范与任务一起保存在 devTask 系统中来实现的,因此每个任务上游映射到需求,下游映射到配置规范,一组更改(代码文件、设计文档、测试文档)等等)

因此,到目前为止,这里的一个结论可能是,只有当您的项目足够大/复杂时(并且您可以在项目的整个生命周期中负担得起 SC 经理的费用:)),那么您才会开始考虑是否需要“继承”行为或真正多功能的工具,否则你将直接使用免费的工具,并且已经照顾了你的 SCM 的一致性
...但是 SCM 工具上可能还有其他因素,可能会让您坚持使用一个或另一个...继续阅读...

一些旁注,这可能超出主题,但我想在某些情况下,比如我的需要予以考虑。

我必须在这里补充一点,我们使用“good-ol CC”而不是UCM。 完全同意 VonC 的观点,良好的方法可以“引导”灵活性,实现更一致的配置。 好处是 CC 非常灵活,您可以找到(不费吹灰之力)一种使事物保持一致的好方法,而在其他 SCM 中您可能可以免费获得它。
但例如在这里(以及我使用 CC 的其他地方),对于 C/C++ 项目,我们无法承担没有 winkin 功能(重用 Derive 对象)的代价,这会减少几个 X次编译时间。 可以说,拥有更好的设计、更加解耦的代码和优化 Makefile 可以减少编译整个东西的需要,但有些情况下,您需要每天多次编译整个野兽,并共享 DO 保存大量的时间/金钱。
我现在的情况是,我们尝试尽可能多地使用免费工具,并且我认为,如果我们能找到一个更便宜或免费的工具来实现 winkin 功能,我们就会摆脱 CC。

我将以 Paul 提到的一些内容作为结尾,对于不同的目的,不同的工具比其他工具更好,但我要补充的是,您可以通过具有连贯的过程且不牺牲可重复性来摆脱工具的某些限制、SCM关键点
最后我猜这个问题的答案值得吗?取决于你的“问题”、你正在运行的SDLC、你的SCM流程,以及是否有任何额外的功能(比如winkin)在您的环境中有用。

我的 2 美分

I'll try to answer you question. (I have to say here that I have not used GIT only read about it, so if something that I mention below is wrong, please correct me)

"Can you enumerate scenarios where this inheritance is a must?"

I won't say it is a must, because you can solve a problem with the tool you have, and might be a valid solution for your environment. I guess it is more a matter of the processes than the tool itself. Making sure your process is coherent and also allows you to go back in time to reproduce any intermediate step/state is the goal, and the plus is that the tool let you run you your process and SCMP as painless as possible

The one scenario I can see it is handy to have this 'inheritance' behavior and use the power of the config spec, is when you want your set of changes "isolated" mapped to a task (devtask, CR, SR, or whatever defines the purpose/scope of your change set)

Using this composition allows you to have your development branch clean and still use different combination (using composition) of the rest of the code, and still have only what is relevant for the task isolated in a branch during the whole life cycle of the task, just until the integration phase.

Being purist having to commit/merge/rebase just to have a "defined starting point" , I guess it would 'pollute' your branch and you will end up with your changes + others changes in your branch/change set.

When/Where this isolation is useful?
The points bellow might only make sense on the context of companies pursuing CMM and some ISO certifications, and might be of no interest for other kind of companies or OSS

  • Being really picky, you might want to accurately count the lines of code (added/modified/deleted) of the change set corresponding to a single developer, later used as one input for code and effort estimations.

  • It can be easier to review the code at different stages, having just your code in a single branch (not glued with other changes)

On big projects with several teams and +500 developers actively working concurrently on the same base code, (where graphical individual element version trees looks like a messy tangled web with several loadlines, one for each big customer, or one for each technology ) large config specs using composition of several degrees in depth made this amount of people work seamlessly to adapt the same product/system (base code) to different purposes. Using this config spec, dynamically gave each team or sub team, a different view to what they need and from where they need to branch of, (cascading on several cases) without the need of creating intermediate integration branches, or constantly merging and rebasing all the bits that you need to start with. Code from the same task/purpose was branching of different labels but made sense. (You can argue here the 'known baseline' as a principle of the SCM but simple labels contemplated in a written SCM Plan did the work)
It must be possible to solve this with GIT (I guess in a non dynamic way) but I find really hard to picture without this 'inheritance' behavior.
I guess the point mentioned by VonC "if branched, all its files will branch from the same unique starting point" was broken here, but beside it was well documented on the SCMP, I remember there were strong business reason to do it that way.

Yes building these config specs that I mentioned above was not free, in the beginning there where 4-5 well paid people behind the SCM but were later reduced by automated scripts that asked you what you want on terms of labels/branches/features and will write the CS for you.

The reproducibility here was achieved by just saving the Config Spec along with the task in the devTask system, so each task upstream mapped to requirements, and downstream mapped to a config spec, an a set of changes (code files, design documents, test documents etc)

So up to here one conclusion here might be, only if your project is big/complicated enough (and you can afford SC Managers along the life of the project:) ) then you only will start thinking if you need the 'inheritance' behavior or really versatile tool, otherwise you will go directly to a a tool that is free and already take care of the coherence of you SCM
... but there could be other factors on the SCM tool that might make you stick to one or to another ...read on..

Some side notes, that might be out of topic, but I guess in some cases like mine need to be considered.

I have to add here that we use the "good-ol CC" not UCM. Totally agree with VonC on the a good methodology allows to "guide" the flexibility towards a more coherent configuration. The good thing is that CC is pretty flexible and you can find (not without some effort) a good way to have thing coherent while in other SCM you might have it for free.
But for example here (and other places that I've worked with CC) for C/C++ projects we cannot afford the price of not having the winkin feature (reusing the Derive objects), that reduce several X times compiling time. It can be argued that having a better design , a more decoupled code, and optimizing Makefiles can reduce the need to compile the whole thing, but there are cases that you need to compile the whole beast many times a day, and sharing the DO saves heaps of time/money.
Where I'm now we try to use as much free tool as we can, and I think we will get rid of CC if we can find a cheaper or free tool that implements the winkin feature.

I'll finish with something that Paul mention , different tools are better that other for different purposes but I will add that you can get away from some limitation of the tool by having a coherent process and without scarifying reproducibility, key points off the SCM
In the end I guess the answer to it is worth? depends on your "problem", the SDLC you are running, your SCM processes, and if there is any extra feature (like winkin) that might be useful in your environment.

my 2 cents

浮生未歇 2024-07-24 11:47:21

撇开理论不谈,从我多年来在商业生产环境中使用 AccuRev 的角度来看,这里有一种明显的实际做法:只要子流与祖先流没有太大分歧,继承模型就可以很好地工作。仍在开发中。 当继承流差异太大时,它就会崩溃。

继承(更高版本作为早期版本的子版本)允许祖先流中的更改在子流中处于活动状态,而无需任何人执行任何操作(除非需要合并,在这种情况下它显示为深度重叠,这很高兴能够看到)。

这听起来很棒,而且在实践中也确实如此,因为涉及的所有流都相对相似。 我们将该模型用于给定生产版本以下的修补程序和服务包级别流。 (对于我们来说,这实际上比这更复杂,但这是总体思路。)

生产版本是并行的,没有继承,每个修补程序和服务包子版本都在它们下面。 启动新版本意味着创建新的版本级别流,并手动将先前版本的最新维护流中的所有内容推送到其中。 此后,对早期版本的更改适用于以后的版本,必须手动推送到每个版本中,这需要更多的工作,但允许更大的控制。

我们最初在所有版本中使用继承模型,其中后来的版本是早期版本的子版本。 这在一段时间内运作良好,但随着时间的推移变得难以管理。 各个版本之间的主要架构差异使得继承更改不可避免地成为一个坏主意。 是的,您可以在中间放置快照来阻止继承,但是所有更改都必须手动推送,并且父快照子流和并行非继承流之间的唯一真正区别在于整个图形流视图不断下推右边是 PITA。

AccuRev 的一大好处是您始终拥有这种选择。 它不是 SCM 程序架构的固有约束。

Theory aside, here's a kind of obvious practical take on this, from my perspective using AccuRev in a commercial production environment for a number of years: The inheritance model works very well as long as child streams haven't diverged too much from ancestors that are still in development. It breaks down when the inheriting streams are too different.

Inheritance (later versions as children of earlier ones) allows changes in ancestor streams to be active in child streams without anyone doing anything (unless a merge is required, in which case it shows up as deep overlap, which is good to be able to see).

That sounds great, and in practice it is, when all streams involved are relatively similar. We use that model for hotfix and service pack level streams below a given production release. (It's a actually a bit more complicated than that for us, but that's the general idea.)

Production releases are in parallel, no inheritance, with those hotfix and service pack children below each of them. Starting a new release means creating a new release-level stream, and manually pushing everything from the most recent maintenance stream for the prior release into it. After that, changes to earlier releases that apply to later ones have to be manually pushed into each of them, requiring more work, but allowing much greater control.

We originally used the inheritance model across all releases, where later ones were children of earlier ones. That worked well for a while, but got unmanageable over time. Major architectural differences across releases made unavoidably inheriting changes a Bad Idea. Yes, you can put a snapshot in between to block inheritance, but then all changes have to be pushed manually, and the only real difference between parent-snapshot-child and parallel non-inheriting streams is that the entire graphical stream view continually pushes down and to the right, which is a PITA.

One really nice thing about AccuRev is that you have this choice, all the time. It's not a inherent constraint of your SCM program's architecture.

呢古 2024-07-24 11:47:21

您是否注意到您也可以使用 GIT 查看特定文件版本?

只需使用这个:

git checkout [< tree-ish >] [--] < paths >

就像每个配置规范一样,文件(路径)的任何现有版本都可以加载到工作树中。 引自 git-checkout 文档:

以下序列检查 master 分支,将 Makefile 恢复到两个修订版,错误地删除 hello.c ,然后从索引中取回它:

$ git checkout master             
$ git checkout master~2 Makefile             
$ rm -f hello.c            
$ git checkout hello.c            

Have you noticed that you can checkout specfific file versions with GIT too?

Just use this:

git checkout [< tree-ish >] [--] < paths >

Like per config spec any existing version of a file (paths) can be loaded into the worktree. Quote from git-checkout docs:

The following sequence checks out the master branch, reverts the Makefile to two revisions back, deletes hello.c by mistake, and gets it back from the index:

$ git checkout master             
$ git checkout master~2 Makefile             
$ rm -f hello.c            
$ git checkout hello.c            
太阳公公是暖光 2024-07-24 11:47:21

ClearCase 没有 MultiSite,是一个单一存储库,但 Git 是分布式的。 ClearCase 在文件级别提交,而 Git 在存储库级别提交。 (最后一个区别意味着最初的问题是基于误解,正如其他帖子中指出的那样。)

如果这些是我们正在讨论的差异,那么我认为“线性”与“DAG”是一种令人困惑的区分方式这些单片机系统。 在 ClearCase 中,文件的所有版本都称为文件的版本“树”,但实际上它是一个有向无环图! 与 Git 的真正区别在于 ClearCase 的 DAG 存在于每个文件中。 因此,我认为将 ClearCase 称为非 DAG 而将 Git 称为 DAG 是一种误导。

(顺便说一句,ClearCase 的目录版本与文件版本类似 - 但那是另一个故事了。)

ClearCase, without MultiSite, is a single repository but Git is distributed. ClearCase commits at the file level but Git commits at the repository level. (This last difference means the original question is based on a misunderstanding, as pointed out in the other posts here.)

If these are the differences we're talking about then I think 'linear' versus 'DAG' is a confusing way to distinguish these SCM systems. In ClearCase all the versions for a file are referred to as the file's version "tree" but really it is a directed acyclic graph! The real difference to Git is that ClearCase's DAGs exist per file. So I think it is misleading to refer to ClearCase as non-DAG and Git as DAG.

(BTW ClearCase versions its directories in a similar way to its files - but that's another story.)

战皆罪 2024-07-24 11:47:21

我不确定您是否在问什么,但您正在证明 Accurev 流是与 Git(或 SVN)分支不同的工具。 (我不知道 Clearcase。)

例如,正如您所说,使用 Accurev,您被迫使用某些工作流程,这为您提供了 Git 不支持的可审计的更改历史记录。 Accurev 的继承使某些工作流程更加高效,而另一些则不可能。

使用 Git,您可以将探索性编码隔离在本地存储库或功能分支中,而 Accurev 不能很好地支持这一点。

不同的工具有不同的用途; 询问每一个的优点是很有用的。

I'm not sure if you are asking anything, but you are demonstrating that Accurev streams are different tools than Git (or SVN) branches. (I don't know Clearcase.)

For example, with Accurev you are forced, as you say, to use certain workflows, which gives you an auditable history of changes that is not supported in Git. Accurev's inheritance makes certain workflows more efficient and others impossible.

With Git you can have exploratory coding segregated in local repos or in feature branches, which would not be supported very well by Accurev.

Different tools are good for different purposes; it's useful to ask what each one is good for.

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