自动化构建过程是否应该提交对版本控制的更改?
我经常看到自动化构建过程,包括持续集成构建,将构建过程中对源文件所做的更改提交回源代码来源的版本控制存储库*。自动递增版本号是一种常见的情况,但还有其他情况。
我的直觉是,这是一个坏主意,因为它可能会用与构建相关的提交来破坏存储库历史记录,并且构建过程需要防止意外地重新触发自身。但是,我没有任何具体证据表明最好避免在构建期间提交更改。
任何人都可以引用讨论自动构建期间提交版本控制更改的利弊的参考文献吗?
*将更改提交到单独的工件存储库是完全可以接受的。
I have often seen automated build processes, including Continuous Integration builds, commit changes made to source files during the build back into the version control repository that the source originated from*. Auto-incrementing version numbers is a common scenario where this is done but there are others.
My intuition is that this is a bad idea as it can litter the repository history with build-related commits and the build process needs to prevent accidentally re-triggering itself. However I don't have any concrete evidence that committing changes during a build is best avoided.
Can anyone cite references discussing the pros and cons of commit changes to version control during an automated build?
*Committing changes to a separate artifact repository is perfectly acceptable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个元数据,将元数据放入(版本化)数据中是“邪恶的”:有关优点和缺点,请参阅这个答案。
持续集成包括构建自动化,它能够从一组固定版本化数据重现构建。
如果你在同一组中改变任何东西,你就违背了它的目的。
That is a metadata, and putting metadata in (versioned) data is "evil": for the pros and cons, see this answer.
Continuous Integration includes the build automation, which is about being able to reproduce a build from a fixed set of versioned data.
If you change anything back in that same set, you sort of defeat its purpose.