dvcs部分合并(git,hg合并跟踪) [英] dvcs partial merge (git, hg merge tracking)

查看:126
本文介绍了dvcs部分合并(git,hg合并跟踪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于一般DVCS的问题,包括Git和Hg。

在Git和Hg中,合并跟踪都是在提交级完成的,而不是文件/目录级别。



其中一个副作用是您无法轻松进行部分合并:


  • 您已在分支feature_branch_x中修改了30个文件

  • 您只想合并(比方说)使用基于项目的合并跟踪(Perforce,ClearCase,Plastic SCM <= 3.0),您可以选择/ kernel / gui



几个文件合并,然后检入,然后重复合并,待处理的文件将显示出来。



使用Hg,Git:一旦合并(有办法保留文件而不合并)追踪已设置,如果您重复合并,则不会合并任何候选人。



我的问题是您如何看待它??

是否存在您认为部分合并是强制性的情况?你可以没有它生活吗? (合并提交/ cset级别跟踪要快得多)。



免责声明:我为 Plastic SCM ,我们已经转移到4.0中的cset级别跟踪,但是我们想知道是否继续进行项目级别合并跟踪或者甚至两者都是好主意。

解决方案

我的感觉是,想要做一个分支的部分合并是一个迹象,太多被放在一个分支第一个地方。处理这种情况的正确方法是将分支分成两个分支,从而纠正原始错误,而不是通过试图跟踪部分合并来加重错误。我赞成使分支分支变得更容易的SCM功能。


I've one question about general DVCS, including Git and Hg.

In both Git and Hg merge tracking is done at the "commit" level instead of the "file/directory" level.

One of the "side effects" is that you can't easily do a "partial merge":

  • You've modified 30 files in your branch "feature_branch_x"
  • You want to merge ONLY the files under (let's say) /kernel/gui

With "item based merge tracking" (Perforce, ClearCase, Plastic SCM <= 3.0) you can just select a few files to merge, then checkin, then later repeat the merge and the pending files will show up.

With Hg, Git: once you merge (there're ways to keep files out without being merged) the "tracking" is set and if you repeat the merge no candidates to merge are left.

My question is how do you feel about it??

Are there cases where you feel "partial merge" is mandatory? Can you live without it? (merge with commit/cset level tracking is much faster).

DISCLAIMER: I work for Plastic SCM and we've moved to "cset" level tracking in 4.0, but we're wondering whether it could be a good idea to stay with "item level merge tracking" or even allow both.

解决方案

My feeling is that wanting to do a partial merge of a branch is a sign that too much was put in one branch in the first place. The correct way to deal with that situation is to split the branch into two branches, thereby correcting the original error, not compounding the error by trying to keep track of a partial merge. I would favor an SCM feature that made splitting a branch easier to do.

这篇关于dvcs部分合并(git,hg合并跟踪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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