是否可以在拉取请求(Github)中更改其他人的代码? [英] Is it possible to change other people's code in pull requests (Github)?

查看:91
本文介绍了是否可以在拉取请求(Github)中更改其他人的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Github项目中,我看到一个人在Pull Requests部分提出了拉取请求,但是我发现他犯了很多错误,因此需要更正他的代码.可以要求我自己更改代码,而不是要求他更改代码(即,我想自己更正他的代码)吗?以及如何?

On a Github project, I see a guy made a pull request in Pull Requests section, but I find he made many mistakes so his code need to be corrected. Instead of asking him to change his code, is it possible to do it by myself (that is, I want to correct his code by myself)? and how?

我也是该项目的成员,而且我是新手:)

I'm also a member of that project, and I'm new :)

推荐答案

假定原始作者具有足够的响应能力,最好总是请他们进行修复(除非更改可能是明显的错字修复).他们可能有理由按照自己的方式来编写它.

Assuming the original author is responsive enough, it’s always better to ask them to fix it (unless the change is an obvious typo fix, maybe). They might have a reason for writing it the way they did.

如果作者没有反应,而您正在决定是将其修复到位还是重新提交,请问问自己历史记录的阅读方式更加清晰.如果提交会导致回归,则您可能应该将其修复到位(以避免破坏二等分性).如果它可以处理某些情况,而您只想添加更多的情况而又不显着更改现有代码,则最好添加一个新的提交.

If the author isn’t responsive and you’re deciding whether to fix it in place or with a new commit, ask yourself which way the history reads more clearly. If the commit would introduce a regression, you should probably fix it in place (to avoid breaking bisectability). If it handles some cases and you just want to add more cases without significantly changing the existing code, it might be better to add a new commit.

如果确实以任何方式修改了现有的提交,请确保在提交消息中留下注释,以说明您所做的更改.一种典型的样式是将注释放在方括号中,并与任何签字者:线(如果适用)一起分组: [your.email@example.com:为了清楚起见,将新案例重构为一个函数] 例如:linux.git commit b44129b3.

If you do amend the existing commit in any way, make sure to leave a note in the commit message explaining what you changed. One typical style is to leave a note in square brackets, grouped with any Signed-off-by: lines (if applicable): [your.email@example.com: Refactor new cases into a function for clarity] For example: linux.git commit b44129b3.

通过 https ://www.quora.com/GitHub-Is-it-bad-etiquette-to-change-someones-pull-request-before-committing

这篇关于是否可以在拉取请求(Github)中更改其他人的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆