1

At work we're currently using CA SCM (the client is called Workbench, formerly Harvest) for version control of Oracle PL-SQL code. It's pretty bad at the latter, but makes it possible for auditing purposes to keep track of who (and when) approved a particular code change to be promoted to our test and production environments.

We've also started using Git the last year or so as version control for our various other projects (many different languages, but web apps are primarily now written in Grails). A few coworkers have also been investigating whether we should use the gitflow workflow or not. We currently tag all of our software when we believe it is ready for review and approval.

With the background out of the way, it occurs to me that one might create both a "test" and "prod" remote branch, and since Gitolite and Stash both allow for per-branch permissions we could restrict those branches to only those allowed to approve code promotion/deployment. But I'm still very much a Git newbie, and I can't quite put all the pieces together myself.

Is there a way to set all of this up so that Git can function as an approval system in addition to everything else it does? Specifically, both the test and prod branches would need to retain only those commit messages relevant to when code changes were merged/rebased/whatever with them. I think that we could have a hook script create these branches automatically with --orphan, but it's not clear to me how a manager would push a tagged release to test or prod.

Can someone get me pointed in the right direction?

4

2 回答 2

3

我见过的最接近的批准系统是添加一个中间gerrit 管理的repo。

像 Gerrit 这样的审查系统中,您可以添加钩子,当足够多的“提交批准”已被投射时,这些钩子会自动执行操作。

于 2013-11-10T09:05:23.610 回答
1

如果你愿意使用 GitHub 作为 git 的前端,你可以通过让每个人都有自己的代码分支并将拉取请求提交到测试或生产分支来获得类似的东西。当有人批准拉取请求时,GitHub 将自动创建一个合并提交,批准人作为作者。您还可以通过重新访问合并的拉取请求来查看信息。

于 2013-11-10T16:40:17.107 回答