2

This is as much a technical issue as a license issue, but I would appreciate correction if any of my assumptions about how the licenses work are incorrect.

Assume that I want to use a patch file from an open source project. That project is licensed under Apache, but the original project that is being patched is licensed under GPL3. The patch file has no specific license and no copyright information. I believe this makes the patch file licensed under the original GPL3 license, and that it is required that my project adds a license and copyright notice to the patch in order to use it. Please correct me if I'm wrong.

How does one properly add a copyright and license notice to the .patch file, which is either a diff or a git diff? Is there a safe way to add a comment that's compatible with both systems? If so, where in the file should the comment be added? If not, should there be a separate file that specifies the copyright and license that in some way points to the patch?

7
  • 1
    Let me get it straight: the patch file comes from an Apache-licensed project, but you want to use/apply the patch to a GPL3-licensed codebase? That is, you want to take code from an Apache-licensed project and put it into a GPL3 project, by means of a patch/diff file?
    – Brandin
    Commented Jan 16, 2023 at 5:02
  • For the technical question (add "comments" to a diff file), see this SO answer: stackoverflow.com/questions/18979120/…
    – Brandin
    Commented Jan 16, 2023 at 5:07
  • @Brandin Not quite. The patch file comes from an Apache-licensed project, but the application that it patches is a separate GPL3 licensed project that the Apache project contains build files for. In my research, while normally elements of the Apache project would be under the Apache license, patches are licensed according to their original code unless otherwise specified. If this is wrong, I would appreciate the correction.
    – YonKuma
    Commented Jan 16, 2023 at 19:17
  • @Brandin The technical link is much appreciated
    – YonKuma
    Commented Jan 16, 2023 at 19:19
  • In the common case, a patch file will be derivative of the original code. For example, imagine a patch that changes a few lines to fix a bug. This patch file will be considered a derivative work of that code that was changed (usually a patch file also contains some portions of the original code as context). However, it would not be wise to assume that a derivative work is always licensed the same. An explicit license is always preferable. If the patch file is in an Apache-licensed proejct, then the explicit license of that file is Apache.
    – Brandin
    Commented Jan 17, 2023 at 8:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.