Re: gitoxide-compatible licensing of Git's Rust code, was Re: [PATCH 6/7] xdiff: conditionally use Rust's implementation of xxhash
- From
Jeff King <peff@peff.net>
- Date
- Sep 23, 2025, 17:48 UTC
- Message-ID
- <20250923174825.GB1136654@coredump.intra.peff.net>
- In-Reply-To
- <9818dc92-3569-3e6f-0252-245c2bf0bf84@gmx.de>
On Tue, Sep 23, 2025 at 11:57:18AM +0200, Johannes Schindelin wrote:
Show 11 quoted lines
> It would not even take more than something as simple as GPLv2+exception. > We do have prior art for that: The Git project itself suggests in its very > own `COPYING` file to use the following license in new files: > > This file is licensed under the GPL v2, or a later version > at the discretion of Linus. > > Note the exception? For new Rust code (and of course excluding code that > has been ported verbatim from GPLv2-licensed code), GPL v2 could be used > with an exception along these lines: This file is licensed under the GPL > v2, with the exception that it can be freely used in the Gitoxide project.
I think this "and of course" parenthetical might be a sticking point. Obviously taking the code verbatim and re-licensing it is not allowed. But I think even reading the C code and then writing substantially similar Rust code may be legally questionable. The Rust code under the more permissive license has to either be clean-room, or have permission for re-licensing from the original authors (which is getting to be all but impossible over time as code ends up being touched by many people).
I think this is the same issue that libgit2 ran into. If it were just a matter of porting over and re-writing new features, more of it would have been done. But for code to come under the new license it can't just be a port, but has to be an independent work.
So I wonder if this just creates the same awkward silo between Git's Rust code and its C code (that we already have between Git and libgit2).
> I am not a lawyer (which everybody but laywers are nowadays required to > say), therefore this likely needs some tweaking.
Me either. I do like the goal you're trying to accomplish, but I worry that it will end up causing headaches down the line. Even if we, the developers, are a bit permissive about what constitutes "porting" and don't require a clean-room implementation, this kind of thing scares off the legal teams that approve using the Rust modules in bigger projects. IIRC Microsoft put in a big effort into vetting libgit2's provenance before agreeing to use it in Visual Studio.
-Peff