简体   繁体   English

在分支的合并请求合并后添加到分支是否不好?

[英]Is adding to a branch after its pull request has been merged bad?

I'm working on a project where we branch off of develop for each feature and once the work is done a pull request is made as usual. 我正在开发一个项目,在该项目中我们会为每个功能分门别类地开发,一旦完成工作,便会像往常一样提出请求。

I'm wondering if later on I find I want to make some changes to how I implemented the feature is it better to just make a new branch or, since it's still dealing with that feature, to checkout that branch, merge with develop, make changes and then resubmit a pull request? 我想知道以后是否要对实现该功能的方式进行一些更改,最好是仅创建一个新分支,或者因为它仍在处理该功能,所以要结帐该分支,与development合并,make更改,然后重新提交拉取请求? What is best practice in this situation? 在这种情况下最佳做法是什么?

I would just make a new branch. 我只想做一个新的分支。 The more recent your branch point, the fewer conflicts you'll have to deal with when merging. 分支点越新,合并时要处理的冲突就越少。

Technically, as long as you merge master on top of the feature branch before changing anything, it is not a problem re-using a branch. 从技术上讲,只要在更改任何内容之前将母版合并到功能分支的顶部,重新使用分支就不会出现问题。 However, your project seems to follow the "one branch-per-issue model" and that's why it may be "bad", and also why the question may out of scope for this page. 但是,您的项目似乎遵循“每个问题一个分支的模型”,这就是为什么它可能是“不良”的原因,也是为什么该问题可能超出此页面范围的原因。

Case 1: Faulty implementation 情况1:错误的实现

Although it should not happen since you have done tests on the code, test in real-world applications, and another person checked all that during after your pull-request, there might be still something wrong. 尽管由于您已经在代码上进行了测试,在实际应用程序中进行了测试,并且在拉动请求后另一个人检查了所有这些内容,所以这应该不会发生,但是仍然可能有问题。 I am personally fine with re-open a ticket and its according branch. 我个人可以重新打开票证及其相应分支机构。

Case 2: The feature might be enhanced 情况2:该功能可能得到增强

However, if the feature was doing his job and you soleley want to optimise it, that is a new feature. 但是,如果该功能正在发挥作用,而您又大胆地想对其进行优化,则这一项新功能。 Depending on the tools you're using in the whole development process, you simply want to seperate this new feature (and its discussions etc) from the old one to measure the work/outcome etc properly. 根据您在整个开发过程中使用的工具,您只想将此新功能(及其讨论等)与旧功能区分开,以正确衡量工作/结果等。

If that is "bad" or not is up to your project, used tools, conventions, etc and has to be answered individually. 是否“不好”取决于您的项目,使用的工具,约定等,因此必须单独回答。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM