简体   繁体   English

拉取请求显示在 azure devops 中变基/合并到另一个分支后的旧提交

[英]Pull request shows old commits after rebase/merge to another branch in azure devops

We are trying to adapt Skullcandy git flow - link我们正在尝试调整 Skullcandy git 流程 - 链接

In short the flow is:简而言之,流程是:

  1. Feature branch is rebranched from master功能分支从主分支重新分支
  2. After work on the feature is finished code is rebased/merged to QA branch were it can be additionally tested if needed (Pull request is created here and code review is done)完成该功能的工作后,代码被重新定位/合并到 QA 分支,如果需要可以对其进行额外测试(在此处创建拉取请求并完成代码审查)
  3. After tests are finished we rebase/merge the feature branch to master using another Pull request测试完成后,我们使用另一个拉取请求将功能分支重新定位/合并到主分支

Now we have problems with both merge and rebase using this approach.现在我们在使用这种方法的合并和变基方面都遇到了问题。

Rebase approach:变基方法:

  1. We create PR to QA and master (1 additional commit)我们为 QA 和 master 创建 PR(1 个额外提交)
  2. We complete PR to QA using rebase fast-forward我们使用 rebase fast-forward 完成 PR 到 QA
  3. After PR to QA is completed suddenly PR to master can show additional commits which didn't exist there before.在 PR 到 QA 完成后,突然 PR 到 master 可以显示以前不存在的其他提交。 If I would remove the branch from origin and push it again from local repository and create new PR to master it shows 1 additional commit again correctly如果我要从原点删除分支并再次从本地存储库推送它并创建新的 PR 以掌握它,它会再次正确显示 1 个额外的提交

I'm not sure why this happens.我不确定为什么会这样。 It seems almost like feature branches commit history is rewritten.似乎特性分支的提交历史被重写了。 I'm also not sure if this approach is feasible at all since rebase can create new commit SHA's so they can be shown as changes.我也不确定这种方法是否可行,因为 rebase 可以创建新的提交 SHA,因此它们可以显示为更改。

Merge approach:合并方法:

  1. We create PR to QA and master (1 additional commit)我们为 QA 和 master 创建 PR(1 个额外提交)
  2. We complete PR to QA and master using merge我们使用合并完成 PR 到 QA 并掌握
  3. Problem that occurs here is that since merge created one additional Merge commit after we rebranch from master again for new feature and create new PR to QA it shows Merge commit from master as change.这里发生的问题是,由于在我们再次从 master 重新分支以获取新功能并为 QA 创建新 PR 之后,merge 创建了一个额外的 Merge 提交,因此它将来自 master 的 Merge 提交显示为更改。 It also shows all the changes done in that merge commit in the code review pane which is problematic.它还在代码审查窗格中显示了在该合并提交中所做的所有更改,这是有问题的。

I'm guessing this problem occurs because SHA of merge commits are different on QA and master branches?我猜这个问题的发生是因为合并提交的 SHA 在 QA 和 master 分支上是不同的?

Summary概括

Can you help me to understand why rebase behaves the way it does?你能帮我理解为什么 rebase 会这样吗?

Are there any suggestions as to how we can improve our flow?对于我们如何改善我们的流程有什么建议吗?

We would prefer the master only flow but for that we would need autogenerated testing environments for automated tests and we are not there yet:)我们更喜欢只有主流程,但为此我们需要自动生成的测试环境来进行自动化测试,而我们还没有:)

I was just looking for an answear for this, and found this Microsoft response .我只是在为此寻找答案,并找到了这个 Microsoft 回复

They claim it's a feature - not a bug.他们声称这是一项功能 - 而不是错误。

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

相关问题 Azure devops 拉取请求不要合并其他人的提交 - Azure devops Pull request do not merge commits from someone else 撤消 git rebase/merge/commits to pull request - Undo git rebase / merge / commits to pull request Github请求请求排除'合并分支'提交 - Github pull request exclude 'merge branch' commits 变基和更改分支包括请求请求中的所有合并提交 - Rebase and changing branch is including all merged commits in pull request 进行rebase将重播master分支提交到我的Pull Request中 - Doing rebase adds replays master branch commits into my Pull Request 使用现有合并提交重新设置分支 - Rebase branch with existing merge commits azure devops 会处理基于另一个功能分支的功能分支拉取请求吗? - Will azure devops handle feature branch pull request that was rebased on another feature branch? 在拉取请求之前强制将基础/合并母版转移到功能分支 - Force rebase/merge master to feature branch before pull request 在 Azure DevOps 上检查分支是否仅通过合并提交领先 - On Azure DevOps check if branch is only ahead by merge commits 在 github 的“合并拉取请求”操作之后,所有来自功能分支的提交和一个新的合并提交出现在开发分支上 - After github "merge pull request " action, all commits from the feature branch and a new merge commit appearing on the develop branch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM