magento-lts
magento-lts copied to clipboard
Add OpenMage Contributors Copyright
Description (*)
From discussion #2276
Added @copyright header to 4,687 files that have been modified by the OpenMage project since 2015. The OpenMage project has done great work and deserves its copyright notice.
Instead of a generic 2015-2022 year range, each file has its own specific year, or year range, based on the git history of that file. I've included the script that I used to generate this commit.
The script has comments explaining what it does, but here's an overview:
- Read all the entire commit history of the repo using
git log --pretty='%H %cs %s' - Loop through each commit and try and determine if this was upstream changes from Magento, LLC or if it was a commit from OpenMage contributors. To do this, the script looks for commit messages such as:
- "Import Magento"
- "Merge ... magento-1.*"
- "SUPEE"
- Also, some hardcoded commit hashes that don't fit a pattern
- Loop through each file in the entire repo that contains
@copyrightand find the first and last commit hash from our results in step 2 - Add or update the
@copyright The OpenMage Contributorsline in each file
To see a list of commits attributed to either Magento or OpenMage, run php shell/update-copyright.php dump. I will post the results of that in the next comment so you can see the output here, too.
The rationale behind not using a generic date range is for ease of git diff between versions as suggested by @fballiano. Instead, if the script is run before a version is tagged, then it will only be modifying files that were already changed by a commit in that version.
Here is the output from when I ran the script:
$ time php shell/update-copyright.php
Updated 4687 file(s)
real 3m13.286s
user 2m31.269s
sys 0m48.590s
It did take a few minutes, maybe the reading of git log on each of the 4,000+ files can be optimized.
Also, this PR is made to 1.9.4.x. I can also make a smaller PR to 20.0 since there will be discrepencies. This could create some merge conflicts in the future, but I don't think it will be too bad. For example assume some file has '2015-2019' in 1.9.4.x and '2015-2020' in 20.0 (because there was a 20.0 branch only commit in 2020 to that file). If the file was then changed in 1.9.4.x in 2022, it would conflict I think when v19 is merged into v20. I ask the maintainers to weigh in on that.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Check out this branch and run:
git diff -U0 HEAD~1 | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' | sort -u
That will print all unique changes made in the second commit of this PR. You should only see copyright changes. I will post the output in a follow up comment.
Questions or comments
I have intentionally made two commits in this PR. I think it is best to not squash them.
Other changes from #2276 will be made in a second PR.
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All automated tests passed successfully (all builds are green)
- [x] Add yourself to contributors list
Here's the list commits broken down by Magento, LLC and OpenMage. If anyone spots one that should or shouldn't be attributed to OpenMage, let me know. I'll give it another scan as well.
https://gist.github.com/justinbeaty/c392d17861323374b317e23326b04778
Here's the output of the git diff line to verify only copyright changes were made in the second commit of this PR:
git diff -U0 HEAD~1 | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' | sort -u
+ * @copyright Copyright (c) 2015-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2015-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2015-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2015-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2018 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021 The OpenMage Contributors (https://www.openmage.org)
+// @copyright Copyright (c) 2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
+// @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
Force pushed a few changes in the script:
- Ignore any commits like "Updated copyright", else running the script the next time will update copyright year to 2022
- Ignore .git dir when grepping
- ~~Fix ignore lib dir when grepping~~
- Actually, let's not ignore lib at all
Rebased after #2296 and all checks are green! ✅
Also similar to #2297 another way to verify this commit is:
$ git diff --stat HEAD~1 | cut -f2 -d"|" | sort -u
1 +
4687 files changed, 4687 insertions(+)
Which shows that any file changed had exactly one addition. Otherwise I encourage at least one other person to verify the contents of these massive PRs.
Rebased & optimized the shell/update-copyright.php script a bit.
auch, there's a conflict now :-(
auch, there's a conflict now :-(
No problem, I just dropped the Add OpenMage Contributors Copyright commit, rebased, and ran the script again. This updated the copyright years to be more accurate since we've modified more files since then.
Output of the verify commands now:
www-data@local-dev:~/magento-public/htdocs$ git diff --stat HEAD~1 | cut -f2 -d"|" | sort -u
1 +
5756 files changed, 5756 insertions(+)
www-data@local-dev:~/magento-public/htdocs$ git diff -U0 HEAD~1 | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' | sort -u
+ * @copyright Copyright (c) 2015-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2015-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2016 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2018 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2017 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2018 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2019 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2020 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2021 The OpenMage Contributors (https://www.openmage.org)
+// @copyright Copyright (c) 2021 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
+ * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
+# @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
+// @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
do you think we should change http://www.magento.com to https?
If you mention the range of years in copyright for OpenMage then you will have to update that line annually. At least Magento lines will remain as they are.
All the links in OpenMage should be changed to HTTPS protocol.
If you mention the range of years in copyright for OpenMage then you will have to update that line annually. At least Magento lines will remain as they are.
actually every time we modify a file there may be the need to update the copyright year, most probably we'll do that in batch every once in a while.
- Can't we have a generic "copyright >2015 The OpenMage Contributors" or something like that?
- If we drop the "The" and make it "OpenMage Contributors" sparing some bytes per every file does it sound bad?
There are a lot who have asked this question before us. If you search on the Internet there are many results. Here is one:
https://opensource.stackexchange.com/questions/4282/copyright-notice-must-be-regularly-updated-while-the-project-is-active
As not to make an effort I would suggest 201X-present and we have covered the period. Plus it does not need to be changed permanently.
This would be my proposal:
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2021-present OpenMage Project (https://www.openmage.org)
My arguments. Those of us who contribute are part of the OpenMage Project and the list of contributors is public on the GitHub page. Also, the copyright extends to the present because the project is an active one and it does not stop at a certain year, as was the case with Magento.
* @copyright Copyright (c) 2021-present OpenMage Project (https://www.openmage.org)
I remember that somebody (maybe @Flyingmana) that we shouldn't use "OpenMage Project" since it's not a legal entity? or something like that
https://opensource.stackexchange.com/questions/4282/copyright-notice-must-be-regularly-updated-while-the-project-is-active
mmmm this makes things even more difficult :-(
I see the legal aspect like this. We protected the code referring to an entity called the "OpenMage Project". In case of a violation of the law it would be natural for this "OpenMage Project" to exist as an entity and represent its injured interests in court.
Let's take another example, we are "OpenMage Contributors" and someone steals a part of the code. What do we do then? Can we act legally or can we pretend it's raining? I personally think that line is there with one purpose only. If someone who respects our work wants to use parts of the code it would be better to ask someone's permission. To the Contributors, Owners of "OpenMage Project". As there is no legally constituted entity, only a contributor could have claims from a legal point of view. He will have to prove that he is the creator and many other things.
Do you think we will ever face something like this? I don't think so, but it's good to protect the code so that others don't claim that we stole their work.
"The OpenMage Contributors" came from here: https://www.linuxfoundation.org/blog/copyright-notices-in-open-source-software-projects/ -- We could drop "The", it doesn't matter too much to me, I just stuck to what seemed approved by the Linux Foudation.
Because @fballiano's comment here, I implemented the logic that would update the copyright header only for the years we have made a change. This way if we were to run the update-copyright.php script before each release, only files that were changed in the release would be changed in the copyright update. This makes it so we can compare versions more easily.
Personally, I think the years are okay how they are. If we modified a file only in 2015, we should only claim 2015 in the copyright. Thus 2021-present would be incorrect, as would 2015-present also be incorrect.
Edit: One other example if we had chosen to do just 2021-present. Then what if there is a file we haven't updated yet (it shouldn't have a copyright header) but then we update it in 2023. We then have to do 2023-present there. I'm not sure it would be any better than what's proposed here.
I see the legal aspect like this. We protected the code referring to an entity called the "OpenMage Project". In case of a violation of the law it would be natural for this "OpenMage Project" to exist as an entity and represent its injured interests in court.
@Flyingmana was right IMO. There is no legal entity called the OpenMage Project. Instead, each of us who contribute retain the copyright to the pieces of code we contribute. If someone were to violate the OSS license, it would either be up to any of us to take action, or for an entity such as the FSF (they have a legal team) to represent us.
This PR is less about the legal protection from my standpoint, and more about these two things:
- If someone legally forks this project, we should have credit in the source code
- It makes it easier to justify to business owners that we are active, and can be PCI compliant. Otherwise if the last (c) is 2020, and years from now it's say 2025, it looks like a stale project.
I updated the Magento & License URL to change http -> https. Command used:
find . -type f -not -path '*/\.git/*' -exec sed -i 's;http://www\.magento\.com;https://www\.magento\.com;' {} \;
find . -type f -not -path '*/\.git/*' -exec sed -i 's;http://opensource\.org/licenses/osl-3\.0\.php;https://opensource\.org/licenses/osl-3\.0\.php;' {} \;
find . -type f -not -path '*/\.git/*' -exec sed -i 's;http://opensource\.org/licenses/afl-3\.0\.php;https://opensource\.org/licenses/afl-3\.0\.php;' {} \;
Edit: verification of the last commit:
www-data@local-dev:~/magento-public/htdocs$ git diff -U0 HEAD~1 | grep '^[+-]' | grep -Ev '^(--- a/|\+\+\+ b/)' | sort -u
+ * @copyright Copyright (c) 2006-2018 Magento, Inc. (https://www.magento.com)
- * @copyright Copyright (c) 2006-2018 Magento, Inc. (http://www.magento.com)
+ * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
+ * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
+# @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
+// @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
- * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
- * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
-# @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
-// @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
- * http://opensource.org/licenses/afl-3.0.php
-// http://opensource.org/licenses/afl-3.0.php
- * http://opensource.org/licenses/osl-3.0.php
-# http://opensource.org/licenses/osl-3.0.php
+ * https://opensource.org/licenses/afl-3.0.php
+// https://opensource.org/licenses/afl-3.0.php
+ * https://opensource.org/licenses/osl-3.0.php
+# https://opensource.org/licenses/osl-3.0.php
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
-// @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
-# @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ * @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+// @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+# @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
thank you guys, I'm more than convinced now that this is the way to go.
Would I like a simpler one? yes, but if it doesn't exist than this is what we need to do :-)
I have had to deal with such situations over the years and the companies where I worked had a legal department and thus I saw the approach. When you specify the copyright word in a line of code, it means that you invoke your copyright, ownership rights over the content. This right extends over a period of time.
The Magento team allocated these property rights every time during the period until a new version was released. The fact that it was not updated after the final year is due to the fact that they no longer maintained the project.
In conclusion, this PR is about rights. If it wasn't then we wouldn't insert that line in the code. of course only those files in which changes were made by the contribution of those who made it here.
About to push one more change, there are some other license types in the code I can change http -> https.
Edit: okay, just also updated http://opensource.org/licenses/afl-3.0.php to https://opensource.org/licenses/afl-3.0.php
I spoke a few moments ago with a colleague from the legal department. She says that when the year is mentioned that is the moment when copyrights begin to produce legal effects. But from a legal point of view the situation is much more technical than referring to the invocation of the word "copyright". Se told me that it is better to mention the year in which this right started and the current year.
I spoke a few moments ago with a colleague from the legal department. She says that when the year is mentioned that is the moment when copyrights begin to produce legal effects. But from a legal point of view the situation is much more technical than referring to the invocation of the word "copyright". Se told me that it is better from a legal point of view to mention the year in which this right started and the current year.
Does she mean the current year, or the most recent year the file was updated?
Right now it is $FIRST_YEAR_WE_CHANGED_FILE - $MOST_RECENT_YEAR_WE_CHANGED_FILE, ie. the two years separated by a dash.
If we do the current year, then we have the problem of a huge commit every year which makes things a bit messy with git.
here: https://opensource.stackexchange.com/questions/4282/copyright-notice-must-be-regularly-updated-while-the-project-is-active they were saying only the years when a single file is actually modified 🧐
@justinbeaty - She says to mention the year you created something, anything, even a modification. That is the zero moment from which you start to claim ownership of the changes. If you still make changes to the work along the years and you want it to be known that the initial variant is no longer the same then you can also mention the current year. It starts to make sense why in Magento there are start and end years. For sure they requested legal assistance for such of commercial platform.
here: https://opensource.stackexchange.com/questions/4282/copyright-notice-must-be-regularly-updated-while-the-project-is-active they were saying only the years when a single file is actually modified 🧐
We could do that if we like with the same script in this PR. I just did follow Magento's lead and used a range which seems like there's debate about.
@justinbeaty - She says to mention the year you created something, anything, even a modification. That is the zero moment from which you start to claim ownership of the changes. If you still make changes to the work along the years and you want it to be known that the initial variant is no longer the same then you can also mention the current year. It starts to make sense why in Magento there are start and end years. For sure they requested legal assistance for such of commercial platform.
That should be what this PR as it is accomplishes. Examples:
- If we changed a file in 2015 only, it says (c) 2015.
- If we changed a file in 2015 and 2020, it says (c) 2015-2020.
- If we changed a file in 2022 only, it says (c) 2022.
- If we never changed a file, it does not add (c) The OpenMage Contributors at all
I also excluded trivial changes, like the removal of the DISCLAIMER notice, else we would be claiming copyright on every single Magento file.
@fballiano - in that article one reference is made to the fact that Facebook has given up specifying the year. This is also an approach, but if it comes to legal implications, they will have to prove in court when that right began.
If we look at the bottom of GitHub we see (c) 2022 GitHub, Inc.
To me, the way this PR does it now, it's ok
@justinbeaty - what you showed in the examples I consider it represents the best legal explanation that I received. If we can make these changes without effort it is fine for me.