在使用git时,如何告诉TeamCity将合并视为一次提交? [英] How to tell TeamCity to treat merges as a single commit when working with git?

查看:61
本文介绍了在使用git时,如何告诉TeamCity将合并视为一次提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近从SVN转到了git.我们使用一个主要的发行"分支(master),并为开发人员正在处理的每个功能提供功能分支.在 TeamCity 中,我们为每个功能分支都有一个项目,当然还有针对主功能的项目.

We recently moved from SVN to git. We work with a main "release" branch (master), and feature branches for every feature a dev is working on. In TeamCity we have a project for every feature branch, and of course a project for the master.

当我们使用SVN时,每当有人从master合并到其功能分支(反之亦然)时,TeamCity会将合并视为一次提交.现在,使用git,每次合并都会使TeamCity显示此合并附带的所有提交.

When we worked with SVN, whenever someone merged from master to his feature branch or vice-versa, the merge was treated by TeamCity as one commit. Now, with git, every merge causes TeamCity to show all of the commits that came with this merge.

这会引起一些问题,例如,当某人从master合并到他的功能分支时,由于合并,他的TeamCity项目现在显示"283个待处理的更改",如果构建失败,则将通知这些更改的作者,因为如果他们在功能分支上做了这些更改.

This causes some problems, for example when someone merge from master to his feature branch, and now his TeamCity project shows "283 pending changes" due to that merge, if builds fail, the authors of these changes will be notified, as if they did these changes on the feature branch.

有没有办法告诉TeamCity将git合并视为单次提交?

Is there a way to tell TeamCity to treat git merges as single commit?

我们可以使用压缩合并来解决它,但这是我们真正要避免的事情.

We could solve it using squashed merges but that's something we would really like to avoid.

推荐答案

这是两种可能的解决方案:

These are two possible solutions:

  1. 一种解决此问题的方法(尽管可能很尴尬,具体取决于您的情况)是在构建配置级别上通知用户,而不是通知已提交/被合并的用户.为不同的主题分支创建单独的构建配置,并为每个构建配置配置通知,以便仅通知主题分支的所有者".

  1. One way to solve this (though possibly very awkward, depending on your situation) is to notify users on the level of a build configuration as opposed to notifying who committed/was merged. Create separate build configurations for different topic branches and configure notification per build configuration so that only the 'owner' of the topic branch is notified.

不确定,但值得一试:您可以按主题分支配置通知,例如通过分支路径上的通配符模式.这应该可以通过使用DYI 自定义通知程序插件来实现.分支名称属性teamcity.build.vcs.branch.< my_vcs_name> .

Less sure, but worth a try: You could configure notification per topic branch(es), e.g. by wildcard patterns on the branch path. This should be possible by means of a DYI custom notifier plug-in that uses e.g. the branch name property, teamcity.build.vcs.branch.<my_vcs_name>.

TeamCity电子邮件通知的特定限制(应该易于支持)是您不能通过构建配置的组合和忽略不是由我的更改引起的故障"来过滤通知.然后至少可以为main分支配置构建,以便通知提交者,并仅为主题分支项目创建特定设置.

A specific limitation of TeamCity email notification (it should be easy to support) is that you can not filter notifications by a combination of build configuration and 'Ignore failures not caused by my changes'. Then at least you could configure the build for the main branch so that committers are notified, and create specific settings only for the topic branch projects.

这篇关于在使用git时,如何告诉TeamCity将合并视为一次提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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