简体   繁体   English

如何在 github 上一次测试多个拉取请求?

[英]How to test multiple pull-requests at once on github?

I reported a bug to an open-source repository on Github.我向 Github 上的开源存储库报告了一个错误。 They acknowledged the bug and created multiple pull-requests that supposedly fixed the bug.他们承认了该错误并创建了多个据称修复了该错误的拉取请求。 The problem is I don't know how I can easily test it out.问题是我不知道如何轻松测试它。 If they only create a single PR, I know I can easily test it out with如果他们只创建一个 PR,我知道我可以轻松地测试它

git fetch upstream pull/<pullrequest_id>/head:pr
git checkout pr

Checkout to one of the PR and manually apply the rest is very tedious because the changes for each of the PR are huge.结帐到其中一个 PR 并手动应用其余部分非常繁琐,因为每个 PR 的更改都是巨大的。 What is an easy way for me to test all the PRs at once?对我来说,一次测试所有 PR 的简单方法是什么? The reason they create multiple pull-requests is that they breakdown the bug I filed into multiple sub-bugs, and each of the PRs fixes each sub-bug.他们创建多个拉取请求的原因是他们将我提交的错误分解为多个子错误,每个 PR 修复每个子错误。

One solution is to fetch all the PR branches.一种解决方案是获取所有 PR 分支。 For example, you can do this one at a time with git fetch upstream pull/<id>/head .例如,您可以使用git fetch upstream pull/<id>/head一次执行此操作。 Then create a local branch to merge all of the PR branches into:然后创建一个本地分支,将所有的 PR 分支合并到:

git checkout -b bug_fix master
git merge pull/<id>/head #repeat for each PR

This will allow you to test them all in aggregate, but not individually.这将允许您整体测试它们,但不能单独测试。

If you need to test each PR individually, and you can do this with the automated test suite, you could write a bash script or batch file to iterate over the list of PRs.如果您需要单独测试每个 PR,并且可以使用自动化测试套件执行此操作,则可以编写 bash 脚本或批处理文件来迭代 PR 列表。

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

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