The story of Vim License (Part 1)

Original link: https://blog.othree.net/log/2023/09/10/vim-license-1/

‎vim-license-slide.‎001

This article is the text version I shared with COSCUP last year . I have finally written it after procrastinating it for a long time. The following text begins.

Open Source Software has always been GitHub’s heart (?), so GitHub has always assisted OSS developers in various aspects, including assistance related to Open Source License (open source authorization). In 2013, GitHub launched a small website called choosealicense.com , which introduced the features of non-open source licensing terms in simple terms and helped developers choose open source software licensing terms through some question-and-answer interactions.

In 2016, GitHub further provided a detection function for licensing terms . As long as your library has correct licensing terms information (such as a LICENSE file), and the terms used are also within the detection range, then The licensing terms used by the project will be displayed on GitHub, and the features of the licensing terms will also be provided for visitors to refer to. However, this detection function can only detect some licensing terms. To be more precise, only choosealicense those on the website.

Not long after GitHub launched the license terms detection function, I discovered that the Vim License used by Vim was not within the detection range. Vim License is a very special licensing clause. It was written by Bram Moolenaar, the author of Vim, specifically for the use of Vim. Although the text is written for Vim itself, in fact, many Vim Scripts are also marked with the Vim License, and often even Writing “Same as Vim”, there are actually quite a few projects used, so I have been thinking about it, is it possible for GitHub to support detecting Vim License?

I kept this idea in mind, and finally one day I had the time and the urge to seriously study how to add new supported license terms. Simply put, GitHub’s tool for detecting the license terms used in projects is a Apply a tool written in Ruby called Licensee (I think of it as license + see), and the clause text used by this tool to refer to the comparison is from the choosealicense project (introduced using git submodule). If you want to add new The licensing terms are in choosealicense. Some conditions must be met first:

  • SPDX License Identifier is required
  • To be listed on several major open source licensing lists
  • At least a thousand projects must use it
  • List three notable projects using this license (as examples on the website)

I researched for a while and found that most of the conditions were fine. Even the requirements for the thousand projects were not very sure. According to the search results, I could guarantee that there would be hundreds, but I couldn’t guarantee whether there would be one thousand. But I still went to open it. I made an issue and suggested joining the Vim License. The condition part of the Thousand Projects is to provide what I know (various search results and the status of the Vim ecosystem, it is inferred that the standards should be met), the time is 2017/03/26 , what I thought at the time was that Vim was so famous, I should just open a request and someone would take care of it. Then Mike Linksvayer, one of the main contributors to choosealicense, had several discussions with me, and I just left him there and almost forgot about him. As a result, a year later, the issue was closed because there was no movement!

Of course I was a little shocked when the first issue I opened was closed. To put it bluntly, my thought was probably: “It turns out that even though Vim is so famous, it doesn’t have any privileges!” Anyway, I continued to open it after that. It wasn’t until about another year, in June 2019, that I started to invest in this matter again. Since no one was doing the issue, I had to open a PR instead. So I started to study it seriously, with the goal of course. It is to push the Vim License into choosealicense, so I first carefully check the format of the text file provided. The first thing I found is that in the text of the licensing terms, in addition to the metadata, the text itself can have substitution strings (substitution). , such as common years, names, etc.:

 MIT License Copyright (c) [year] [fullname] Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: ...

Among them, [year] and [fullname] wrapped in [] are the strings that need to be replaced. After discovering this, I also felt that I need to re-examine the text of Vim License to see if there is such a place. However, once I seriously Looking at this point, we found that the problem is not small, and this problem is that the Vim License is not context free, but is highly coupled with Vim. Generally speaking, open source licenses are context free. What are the licensing terms of context free? Woolen cloth? That clause text can be used directly in any project. There is no need to modify the text content. At most, you can modify the name, year and owner information at the beginning and end. But Vim License is not. Just the word Vim . It appears 29 times in the text, and these words Vim most of the time represent the name of the software that uses this license. So assuming that I am vim-pathogen today and want to use Vim License, I should add Vim in the LICENSE file. It is only right to change all the words to pathogen.vim, but among this pile of Vim, there are still some places that represent different meanings. These places are when you are a Vim Maintainer , so after all, so many Vim should be changed. For the replacement string? For this reason, I asked Bram Moolenaar, the author of Vim, who is also the author of Vim License. In fact, I got the answer pretty quickly. The conclusion is that Vim Maintainer needs to remain as it is, but at other times it can be used as a representative of the licensed software. , Vim should be changed to the name of the software.

Discuss Vim License with Bram

So why does Vim Maintainer appear? Here we will introduce the content of Vim License. A simple translation of the terms (informal translation, please do not use it for legal purposes) is as follows:

  1. Unmodified Vim can be distributed freely and arbitrarily;
  2. If you want to distribute modified Vim, you need to meet one of the following conditions;
    1. Provide contact information when publishing. When Vim Maintainer asks you for your modifications, you must provide them free of charge, and Vim Maintainer reserves the right to add your modifications to the official version of Vim;
    2. If you obtain Vim distributed through the method described in the previous article, you can distribute that version without restrictions. If there are new modifications, you must distribute it in the same way;
    3. The source code differences from the original version will be provided when publishing;
    4. When publishing using the previous article, you do not need to provide source code if all of the following conditions are met;
      • The licensing terms you use will not prevent Vim Maintainer from obtaining your modified content for free;
      • You must keep your modified content (differences in the source code) for at least three years. If the user or Vim Maintainer asks you for the modified content during this period, you must provide it;
      • You must ensure that the contact details you provide are valid within three years.
    5. If your modifications are under the GPL, you can release your modified version using GPLv2.
  3. If you publish modified Vim, it is strongly recommended that you use the Vim License and provide the modified source code to Vim Maintainer;
  4. License terms cannot be removed.

If you look closely, you will see that the main goal of this document is to ensure that Vim Maintainer can obtain other people’s modifications. If Vim does not use this licensing terms, no matter what software you use these terms, if there are modifications and then release, You must allow Vim Maintainer to obtain your software source code for free, and Vim Maintainer can decide whether to use the original software. This also makes Vim License a rare open source license that is not context free, and this detail I believe it was first clarified after my discussion with Bram. During the discussion, I gave an extreme example to confirm: Suppose I have a software Released as Y but not open source, it is actually the Vim Maintainer, not me (the author of X), who has the power to obtain Y’s modifications and decide whether to give them to X.

Once I know which places can be replaced, it’s easy. I quickly prepared the vim.txt file to be used to send PR, and then I wanted to test it first. As a result, the detection failed! After repeated research, we found that the detected similarity is only 97.x%, while the threshold set by Licensee is 98%. As for the reason why the similarity is so low, it is actually because there are too many replacement strings in the text. At that time, Licensee did not handle the comparison of replacement strings very well, and the difference in length of the text before and after replacement would also have an impact. After knowing the reason, I was thinking about how to deal with it. Of course, the simplest way is to use special cases. I The approach at that time was that if the Vim License was being detected, the threshold used for judgment would be lowered. After the local test showed no problems, I was ready to submit it back to the Licensee. However, because I was not sure whether this approach was good or not, I I first opened an issue, explained the cause and effect, and then attached my current modifications. I wanted to ask the person in charge what they thought. If they think it is acceptable, I will send a PR. As a result, Mike Linksvayer appeared again! I just discovered that he is the main contributor to choosealicense and Licensee! As for knowing his experience, I only heard from Bobchao after sharing it at COSCUP.

vim.txt in Licensee

Mike Linksvayer was the Policy Director of GitHub at the time, specializing in public-related matters. Before that, he was the CTO and VP of CC. He also served as a board member of several different organizations, such as OpenHatch, Software Freedom Conservancy and Open Definition Advisory. Council, so it can be said that it has been active in the free and open source field for a long time, and even specializes in areas related to licensing terms. But actually I didn’t know that at the time, and I didn’t want to know anything about him. My main impression of him was that his profile picture looked a bit serious, and he always gave me the feeling of T1000. In addition, I mostly interacted with him later (I should say The contribution I submitted is what he is checking), so on some levels I am actually a little afraid of him.

The question raised by Mike on Licensee is that the replacement strings I set in the Vim License do not appear in the SPDX License List . The full name of SPDX is Software Package Data Exchange. In fact, this is relatively rare for ordinary developers. Among the things I have come into contact with, the most commonly seen applications at present, excluding the License List, should be software supply and training related things. However, in fact , the SPDX License List they maintain has almost become an industry standard, especially the license identifier. It can be seen everywhere, such as npm’s package.json , which uses it. In fact, the file format of SPDX License List (customized XML) is different from the file format used by Licensee (customized plain text). However, since SPDX License List is already a data source that everyone uses as a reference index, So it naturally became the upstream of choosealicense. This experience also made me understand that the open source circle really attaches great importance to upstream. I have encountered a similar situation in neovim before, so in short, I should go there first. Submit the PR and modify the SPDX License List, and then send the PR to choosealicense, so I sorted it out and sent the PR there, adding these replacement strings, and then Mike Linksvayer appeared again! He is also a contributor to the SPDX License List!

To be continued

This article is reproduced from: https://blog.othree.net/log/2023/09/10/vim-license-1/
This site is for inclusion only, and the copyright belongs to the original author.