自动化构建过程是否应该提交对版本控制的更改?

发布于 2024-12-20 19:34:28 字数 260 浏览 0 评论 0原文

我经常看到自动化构建过程,包括持续集成构建,将构建过程中对源文件所做的更改提交回源代码来源的版本控制存储库*。自动递增版本号是一种常见的情况,但还有其他情况。

我的直觉是,这是一个坏主意,因为它可能会用与构建相关的提交来破坏存储库历史记录,并且构建过程需要防止意外地重新触发自身。但是,我没有任何具体证据表明最好避免在构建期间提交更改。

任何人都可以引用讨论自动构建期间提交版本控制更改的利弊的参考文献吗?

*将更改提交到单独的工件存储库是完全可以接受的。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝不服输 2024-12-27 19:34:28

自动递增版本号

这是一个元数据,将元数据放入(版本化)数据中是“邪恶的”:有关优点和缺点,请参阅这个答案

持续集成包括构建自动化,它能够从一组固定版本化数据重现构建。
如果你在同一组中改变任何东西,你就违背了它的目的。

Auto-incrementing version numbers

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文