如何将Bug修复分支合并到主干和发布分支 [英] How to merge bug fix branch into trunk and release branch

查看:240
本文介绍了如何将Bug修复分支合并到主干和发布分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请考虑以下情况:

  • 开发主要在主干中完成.
  • 在修复复杂的错误或开发新功能(最初不稳定)时使用分支.
    通常,一旦完成开发,这些分支就会合并到主干中.
  • 1个分支用作当前版本分支(例如当前为"R-1.0").
  • 标记用于发布(将为"R-1.0.0").
  • Development is mainly done in trunk.
  • Branches are used when fixing complex bugs or developing new (unstable at first) features.
    Normally these branches are then merged into trunk once development is done.
  • 1 branch is used as current release branch (say currently "R-1.0").
  • Tags are used for the release (would be "R-1.0.0").

现在必须修复主干以及当前版本1.0.0中的一个复杂错误:

Now a complex bug which is in trunk as well as in the current release 1.0.0 must be fixed:

  1. 将从主干创建分支"BG-1".
  2. 该错误将在此分支中修复.
    同时,开发工作将继续进行.
  1. A branch "BG-1" from trunk will be created.
  2. The bug will be fixed in this branch.
    At the same time development will continue in the trunk.

您现在如何将分支重新整合到主干和"R-1.0"中?

How do you proceed to reintegrate the branch into trunk and "R-1.0" now?

  • 将中继线合并到"BG1",然后将"BG1"重新整合到中继线,然后再合并到"R-1.0".
    =>这不可能是解决方案,因为"R-1.0"将接收自1.0版以来并非所有目标的主干中开发的所有内容.
  • 尝试将"BG1"重新集成到主干中,然后再重新集成到"R-1.0"中,而不合并主干.
    =>这也行不通,因为不属于1.0版的其他更改已属于"BG1"分支.
  • Merge trunk into "BG1", then reintegrate "BG1" into trunk and then into "R-1.0".
    =>This cannot be the solution as this way "R-1.0" would receive all the stuff that was developed in the trunk since release 1.0 which is not the goal.
  • Try to reintegrate "BG1" into trunk and then into "R-1.0" without merging the trunk.
    =>This also cannot work as other changes which weren't part of release 1.0 are already part of the "BG1" branch.

这个问题有解决方案吗?
我看到的唯一解决方案是从"R-1.0"启动"BG1",而不是首先使用中继.如果是这样,这是否意味着开发人员必须为每个错误修复分支找到受支持的最早的发行版,其中包含该发行分支的错误和分支?

Is there any solution to this problem?
The only solution I see would be to start "BG1" from "R-1.0" rather than trunk in the first place. If so, does this mean that for each bug fix branch the developer has to find the oldest supported release which contains the bug and branch from this release branch?

更新:
在主干内和从主干进行所有开发的实践源自是我非常喜欢的一个概念.

Update:
The practice of doing all development in and from trunk originated from this answer by "Jim T" which is a concept I really like.

推荐答案

我建议将中继合并到BG1,然后将BG1重新集成到中继.然后,您可以将一系列修订合并到R-1.0.将BG1重新集成到主干的提交中应仅包含错误修正,因此可以将其合并到R-1.0.或者,您可以将特定的提交合并到BG1中,以修复您的错误.

I would suggest merging the trunk into BG1, then reintegrating BG1 to the trunk. You could then merge a range of revisions to R-1.0. The commit where you reintegrate BG1 to the trunk should only contain the bugfixes, so you could merge that to R-1.0. Or you could merge the specific commits to BG1 that fixed your bug.

根据从R-1.0开始以来干线已更改的多少,您可能必须先手工编辑R-1.0,然后再承诺将更改应用于旧代码.这就是维护旧版本的本质.

Depending on how much the trunk has changed since R-1.0, you may have to hand edit R-1.0 before committing to make the changes apply to the old code. Such is the nature of maintaining old releases.

这篇关于如何将Bug修复分支合并到主干和发布分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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