从 PROD 合并到 HEAD 还是 HEAD 到 PROD?

发布于 2024-07-09 23:07:13 字数 381 浏览 16 评论 0原文

我们有两个分行: 1. HEAD - 最新版本(AKA Trunc) 2. PROD - 发布版本

当你修复发布版本中的 bug 时,你会做以下哪一项:

  1. 在 PROD 中修复,然后合并到 HEAD
  2. 在 HEAD 中修复,然后合并到 PROD

(1)的优点是,这个这样你绝对不会因为意外地从 HEAD 引入未经测试的代码而损害已发布的版本(假设 PROD 总是比 HEAD 更稳定/经过测试)。

(2) 的优点是,一段代码在 HEAD 中的用法可能比在 PROD 中更多,因此,如果您仅在 PROD 中修复,您可能无法找到所有此类用法,从而将错误滑入 HEAD 中。

我个人赞成(1)。 你怎么认为?

We have two branches:
1. HEAD - the latest version (AKA Trunc)
2. PROD - the released version

When you fix bugs in the released version, which of these do you do:

  1. Fix it in PROD, then merge to HEAD
  2. Fix it in HEAD, then merge to PROD

The advantage of (1) is that this way you absolutely cannot harm the released version by accidentally bringing over untested code from HEAD (The assumption is that PROD is always more stable/tested than HEAD).

The advantage of (2) is that there might be more usages for a piece of code in HEAD than in PROD, so if you fix only in PROD you might not find all such usages and so slip bugs into HEAD.

I'm personally for (1). What do you think?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

梦罢 2024-07-16 23:07:13

错误修复应该应用于分支并合并到开发的主线。 您需要这样做,以避免将不打算存在的新功能带入生产版本。 请注意,如果您需要更改 HEAD,最简单的方法可能是在两个分支中应用相同的更改。

Bug fixes should be applied to the branch and merged to the the main line of development. You need to do this to avoid bringing new features into a production release that are not intended to be there. Note that easiest way to do this if you need the change in the HEAD may be to apply identical changes in both branches.

不再让梦枯萎 2024-07-16 23:07:13

(1) 也。

不要忘记,并非所有修复到 PROD 中的错误都必须合并回 HEAD

有时,您当前的代码已经以这样的方式发展,修复到 PROD 中的错误不再相关。

(1) as well.

Do not forget that not every bugs fixed into PROD have to be merged back into HEAD.

Sometimes, your current code has already evolved in such a way the bugs fixed into PROD are no longer relevant.

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