限制推送内容以避免意外推送到开发部门 [英] Restrict the content of push's to avoid accidental pushes to the development branch

查看:87
本文介绍了限制推送内容以避免意外推送到开发部门的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(这是我的

(This is a follow-up question to my earlier question about how to manage standard development and customer-specific development in a cvs.)

我们在mercurial中使用不同的分支来区分标准开发(我们的标准软件的开发)和特定于客户的开发(针对客户的修改的开发)我们的标准软件).

We are using different branches in mercurial to distinguish between standard development (development of our standard software) and customer-specific development (development of customer-specific modifications of our standard software).

所以,可以说我们有以下分支:

So, lets say we have the following branches:

  • 默认(标准开发分支)
  • 修订版1.0 (用于错误修复的标准开发分支)
  • 修订版1.1 (用于错误修复的标准开发分支)
  • customerA (来自"revision1.0"的克隆,并进行了一些更改)
  • default (standard development branch)
  • revision1.0 (standard development branch for bugfixing)
  • revision1.1 (standard development branch for bugfixing)
  • customerA (a clone from "revision1.0" with some changes)

当客户A想要从1.0升级到1.1时,我们只需将版本1.1 拉到 customerA (并解决合并冲突) ).到目前为止,一切都很好.

When Customer A wants to upgrade from 1.0 to 1.1, we simply pull from revision1.1 to customerA (and solve the merge conflicts). So far, so good.

我要避免的是,开发人员意外地将一些特定于客户的代码合并到标准开发分支中.我们可以通过其Java名称空间来识别特定于客户的代码".

What I want to avoid is that a developer accidently merges some customer-specific code into a standard development branch. We can identify "customer-specific code" by its Java namespace.

有什么办法吗?

因为这是正确的术语,所以将推送"更改为合并"

changed "push" into "merge" as this is the correct term

推荐答案

您可以阻止开发人员将错误的提交或合并推送到您的中央"存储库,但是您不能阻止他们在本地进行处理.因此,例如,您可以使用pretxnchangegroup挂钩来确保推送不会在revision1.0分支(或克隆)中产生客户特定的代码,但这只会拒绝开发人员的推送.他或她仍将在本地进行错误的提交,因此需要对其进行揭露.

You can block developers pushing bad commits or merges to your "central" repository but you can't stop them from doing them locally. So you could use, for example, a pretxnchangegroup hook to make sure a push doesn't result in customer specific code in the revision1.0 branch (or clone), but that will just reject the developer's push. He or she will still have the bad commit locally and will need to unravel it.

上面的注释中有些混乱,因为您正在混淆术语.一种是在命名分支之间进行合并,另一种是在存储库之间进行推送.

There's some confusion in the comments above because you're conflating terms. One merges things between (named) branches and pushes things between repositories.

这篇关于限制推送内容以避免意外推送到开发部门的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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