为什么我需要根据许可证提交补丁?

Why do I need to submit a patch under a license?

我使用拉取请求为 github 中的一个项目创建了一个补丁,他们的作者说我需要添加 I am submitting this patch under the XXX license.
的评论 那么为什么我需要在许可下提交补丁?
如果我不添加该评论会怎样?

这不是技术要求。唯一确定的方法就是问那个人。

但是,这很可能是他们项目指南的一部分。通常要求贡献者将版权分配给其他人或组织,或者在贡献代码时明确同意特定的许可。根据许可,这也可能是一项实际的法律要求:除非您同意,否则项目维护者不能发布您根据特定许可编写的代码。

根据您的描述——我进一步假设回购已经包含许可通知(例如 LICENSE 文件),您没有必要为您的贡献添加评论属于存储库的许可。根据 GitHub Terms of Service:

  1. Contributions Under Repository License

Whenever you make a contribution to a repository containing notice of a license, you license your contribution under the same terms, and you agree that you have the right to license your contribution under those terms. If you have a separate agreement to license your contributions under different terms, such as a contributor license agreement, that agreement will supersede.

Isn't this just how it works already? Yep. This is widely accepted as the norm in the open-source community; it's commonly referred to by the shorthand "inbound=outbound". We're just making it explicit.

也就是说,存储库可能归一家公司所有,该公司的法律顾问已提出内部要求,即为了让存储库接受外部贡献,贡献者需要明确声明。

还有一种情况(但不是您所描述的情况),项目需要 Contributor License Agreement (CLA),因为例如,项目所有者希望您说明你实际上有权做出你所提供的贡献(例如,它不是你作品中的一些专有代码)或者甚至分配你的版权(例如,这样项目就可以对违反许可证的人提出法律索赔,或者以后再-许可代码而无需追踪并获得每个贡献者的批准)。 Apache、Google、Facebook、Canonical 和 Fedora 项目(以及许多其他项目)都需要 CLA。

根据您对争论的强烈程度,您可以将项目维护者指向 GitHub 的服务条款(上面链接)以及 Ben Balter 的“Why you probably shouldn’t add a CLA to your open source project”。

TL;DR:

从常识和GitHub服务条款的角度来看,您已经根据回购许可提交代码,无论您是否添加明确的评论。