An individual recently uploaded 8,642 Spanish laws to a Git repo. A commit was made for every reform.
This is not a figure of speech. A pipeline was developed by a programmer named Enrique López to extract each consolidated Spanish law from the BOE API, transform it into Markdown, and monitor every legislative reform in the form of a dated Git commit.
The repository contains over 27,000 commits. Each one, and its corresponding historical date, represent a genuine legal modification.
You can git diff the Spanish tax code.
Laws Are Just Patches
Ponder that for a moment. Politicians have been generating laws based on existing laws for hundreds of years. "Eliminate paragraph 3 and substitute it with..." That's literally what a modification is. It's an update on top of an update on top of an update.
We've had a mechanism to improve the process since 2005. We just haven't used it.
The Spanish project isn't alone. France built OpenFisca to convert tax law into executable code. New Zealand launched "Better Rules" to co-draft legislation in both human and machine-readable formats. The UK coded the British Nationality Act as logic rules at Imperial College London.
However, the Spanish repo is unique because it is so incredibly simple. No custom domain-specific language. No blockchain. No AI. Just Markdown files stored in a Git repository complete with an appropriate modification history.
Any software developer worldwide can incorporate it into their project.
The Oldest Code Humans Ever Wrote
Here's why this story matters more than just a "neat endeavor." Legal text is potentially the most ancient version of "code" that humans produced. The Code of Hammurabi was essentially a series of if-else statements inscribed into stone roughly in 1760 BC.
We've been version controlling software for ages. But the regulations that govern society? They are retained in PDFs, government books, and modification papers that reference other modification papers.
If a law is altered, you can't just run git blame to identify the individual who made the modification. You have to browse a text that states "in article 14, subsection 3, replace the second paragraph with the following text."
That isn't transparency. That is deliberately obscuring the information.
Git Already Solved This
The Spanish initiative eliminated all of that.
→ Want to perceive how data privacy laws altered over the prior decade? git log
→ Want to contrast two forms of a financial regulation? git diff
→ Want to trace when a specific clause was introduced? git blame
The mechanisms already exist. The mental model already exists. The only thing missing was for someone to put it into practice.
The repo is MIT licensed for the structure and tools. The laws themselves are public domain because they're, well, laws.
Every Country Should Have This
I believe every nation should create this. Not as a "wouldn't it be cool" open-source project. As the formal regulation for releasing legislation.
Picture being able to subscribe to changes in labor law in the same way you track a GitHub repository. Imagine if policy debates were presented in pull requests allowing you to monitor the exact modification being proposed.
We already have the structure. Git manages countless repositories that encompass billions of modifications. Including a few thousand laws per country wouldn't even have an effect.
The actual question is whether governing bodies would ever consider doing this. And, to be truthful, the Spanish Supreme Court may have already unlocked that gate. In September 2025, they established that residents are constitutionally entitled to the transparency of algorithms utilized by the government.
If the code that generates automatic decisions must be transparent, shouldn't the regulations based on the judgments also be accessible?
What do you think — should laws be versioned, or does legal text require the ambiguity most? 👇
Top comments (0)