8

Let's say we have repo A with a copyleft license like GPL. Let's say someone forks repo A to repo B and creates some modifications. Let's say the owner of B had no intention of contributing their changes to the upstream, but the original authors were interested in the modifications. Could the the authors of A (or some third party) legally "copy" the new code from the fork back to the upstream?

If yes, would attribution be required? (If we want to get into source control specifics, like Git, would it have to be the same commit?)

4 Answers 4

9

Yes, those changes could be added to any other repository - on the same conditions as the license asks.

It would not need to be the same commit or identically as the license is agnostic of the VCS used. But you would need to acknowledge the original author of that commit as usual. How to do that in practical terms might look different on circumstances. One might honour it in the commit message, could fudge the author data on commit, add it to the contributors list or as a note in the source itself at the appropriate place - or all of it.

12
  • 8
    Relying only on the commit messages to comply with the notice/attribution requirements would be a mistake, in my opinion. It's too easy for those to be excluded or missed by normal usage of source control tools. For example, if I use GitHub's "Download ZIP" feature, or SVN's "svn export" feature, then the resulting source tree should in principle still be a license-compliant copy. I.e. the attribution/notices really ought to be in the source tree somewhere as well.
    – Brandin
    Commented Aug 2, 2023 at 5:42
  • @Brandin That is the problem of the use of the "Download ZIP" feature. Unless you are saying someone including the attribution in the commit message, treating the repo as the work, is in violation. Commented Aug 2, 2023 at 13:27
  • Does "Download ZIP" not include the .git directory? Commented Aug 2, 2023 at 13:52
  • 1
    @davidbak I was not thinking of faking the author (that would be faking), but to add the textual author info like "[email protected] <planetmaker based on work by davidbak>" Commented Aug 2, 2023 at 16:37
  • 1
    @davidbak The metadata is, as well as the graph of previous commits, but the repository isn't. You cannot distinguish whether the commit was made to the upstream repo, to the downstream fork repo, or to the repo on my local harddisk. It doesn't matter, its the same commit in any of them.
    – Bergi
    Commented Aug 2, 2023 at 20:22
4

Stepping back a bit, the fundamental point of open source is that anyone can take open source code and do anything with it.

Hopefully this makes the answer to your question obvious: it doesn't matter if the code was written by the upstream author, the downstream author, the upstream author's best friend, the downstream author's employee, the upstream author's worst enemy or anyone else: the upstream author (or the downstream author. Or anyone else) can take that code and use it however they wish.

1
  • 4
    Not anything. Very nearly all open source licenses place some restrictions. And the OP specifically asks about a copyleft license, which by definition will have more restrictions than most non-copyleft open-source licenses. Commented Aug 3, 2023 at 17:04
3

Copyleft generally only applies when you redistribute the work or a derived work, but it doesn't require you to distribute it. If you made the copy just for personal use, repo B can be a private repo, and the authors of A (or a third party) would not be authorized to copy anything from it. The only redistribution requirement is that if you distribute object code you also have to distribute source code.

But if repo B is made public, I think its owner is implicitly authorizing anyone to copy from it, and this must be done in accordance to the requirements of the original copyleft license from A. This is the nature of copyleft -- it requires that whenever you pass on a copy of the original work or a derivative, you also pass on the same license (or a similar license, so long as it maintains these requirements).

So if the original license allows making derivatives without attribution, and you redistribute, you must also allow making derivatives without attribution.

7
  • Probably the second paragraph gets at the heart of the issue and is worth expanding. Copyright means the rights holder has sole authority to redistribute the work, which is implicitly what the OP question is about. But a copyleft license like GPL means that copyright doesn't apply as it otherwise might.
    – BurnsBA
    Commented Aug 2, 2023 at 17:21
  • 2
    Well, copyleft is based on copyright. When you copyleft something, you're saying "By virtue of my copyright, I authorize you to copy the work as long as you follow these rules when you redistribute." And those rules include passing on the same rules.
    – Barmar
    Commented Aug 2, 2023 at 17:24
  • I'm not sure what you mean by expanding on it, unless you mean explaining how copyleft works in detail.
    – Barmar
    Commented Aug 2, 2023 at 17:26
  • 1
    I've added some more details.
    – Barmar
    Commented Aug 2, 2023 at 17:35
  • 5
    Read my first sentence: It's not required to be redistributed. You only have to distribute source if you distribute the object code. If you're just using it personally, you don't have to distribute anythning.
    – Barmar
    Commented Aug 2, 2023 at 20:21
0

Specifically in terms of the GNU GPL:

B has made a derivative work. The GPL requires that if B distributes this work to A (e.g. by publishing on a web site or public VCS repository), then that B must grant A all the freedoms of the GPL in respect of that derived work.

Therefore A is entitled to make and publish a work derived from B's code (in this case, by incorporating parts of it into A's original).

A can copy B's code in any way, and make whatever modifications desired. There's no requirement to preserve the form (such as the sequence of commits) any more than B was required to preserve the exact form of A's code earlier.

As a practical matter, A will probably find it helpful to take B's commits as they are, before making changes on top of them, especially if anticipating further contributions from B. But nothing in GNU GPL requires that.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.