3

Should I put the complete text of BSD or MIT license to every file?

For longer licenses like GPL or MPL, there is a license notice. It is relatively short text that says what license is selected for the file. Just license notice instead of long text of the license is placed to each file. For MPL it is just 3 lines:

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.

For GPL it is longer but some authors just use only the first paragraph:

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

But I couldn't find license notice for BSD and MIT licenses. What can I use instead? Can I just add:

This program is published under 2-clause BSD License. Refer the COPYING file for the full text of the license.

Is there better / commonly accepted wording of generic license notice?

What about license text itself? Suppose I put the license text to separate file named COPYING. The BSD license says: Redistributions of source code must retain the above copyright notice. But If I put copyright notice to the license file, it will cover license text itself, not my program. But I don't own license text. Also sometimes it is impossible to specify all authors of the program because there are many of them and each file is copyrighted by different authors.

Can I use the following text as copyright notice?

The program that is the subject to this license is copyrighted by its authors.

But I guess it is not valid copyright notice.

I can remove the copyright notice and the requirement to retain "the above copyright notice", but it won't be BSD license after that.

Are there other options? I really don't want to copy BSD license text to every file since it is quite long and it is against DRY (Don't Repeat Yourself) principle.

1

2 Answers 2

4

If I put copyright notice to the license file, it will cover license text itself, not my program

Taking this specific point, I understand your concern, because of licences like the GPL where the licence text itself is under a more restrictive licence than code covered by the licence, and redistribution of modified versions of the licence text is often not permitted. But in the case of the MIT and BSD licences, authorities (including the OSI (for MIT) and the Linux Foundation (for BSD)) advise putting your copyright notice at the head of the licence text, not the copyright notice of the licence's authors. Such a practice is well understood, and is unlikely to be read by anyone as an attempt to "land grab" the licence text itself.

I would advise against using a copyright notice of the form you suggest ("The program that is the subject to this license is copyrighted by its authors"), not because it's not valid - as we have discussed before (example), the copyright notice has almost no function in modern copyright law, nearly anywhere in the world - but because it's unusual, and therefore potentially confusing. You don't want people to have to stop and think hard about whether they can really use your code under the terms you intended.

I really don't want to copy BSD license text to every file since it is quite long and it is against DRY (Don't Repeat Yourself) principle

I would advise you not to worry too much about that. The BSD licence text is less than 600 bytes, and that doesn't really signify in the modern world. For any significant source code, the indents from the left margin will take more space than that, and you don't see people advocating for left-justified source to save bytes.

Moreover, it's (again) really helpful to downstream users to have the licence status clear in every file. You don't know when someone will find that one file you've written, with a single function in it, is exactly what they needed to provide the missing brick in the project they're building. Later, someone else may admire the elegance of your function implementation, and seek to reuse it from that new project. A clear copyright/licence statement at the head of it can be a big help when deciding on reusability, even though it's now out in the world on its own, separate from the body of your original work.

1

But I couldn't find license notice for BSD and MIT licenses. What can I use instead? Can I just add:

This program is published under 2-clause BSD License. Refer the COPYING file for the full text of the license.

Is there better / commonly accepted wording of general license notice?

The BSD and MIT licenses are short enough that you don't need a separate license notice. You can just replicate the actual license text in each file.

That also resolves the issue with the mention of the "above copyright notice", because that phrase then naturally refers to your own copyright notice.

The advantage of having the full license text in each source file is that it becomes harder to accidentally separate the code from the legal text that explains what recipients are allowed to do with the code.

In addition, I would recommend to also have a COPYING or LICENSE file with the text of the license and your own copyright notice. That would cover the files that don't support license texts/notices within the file itself and as a convenience for people that want to find out what license applies to the project.

Your Answer

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

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