I put all 8,642 Spanish laws in Git – every reform is a commit
A developer ingeniously put all 8,642 Spanish laws into a Git repository, treating each reform as a commit with full historical data. This project showcases a brilliant application of version control to a complex, non-traditional domain, making legislation transparent and searchable like code. Hacker News lauded its potential to revolutionize legal understanding and efficiency, sparking discussions on formalizing legal texts globally.
The Lowdown
Enrique Lopez has undertaken an ambitious and widely praised project: consolidating all Spanish state legislation into a Git repository. Dubbed "Legalize España," the initiative converts over 8,600 laws from the BOE (Spain's official gazette) API into Markdown files, with every historical reform since 1960 represented as an individual Git commit.
The core functionality allows users to:
- Navigate to any law, represented as a Markdown file (e.g., the Spanish Constitution).
- Use
git logto view the complete history of reforms for a specific law. - Employ
git diffto see exact changes introduced by any particular reform, replacing traditional legal phrasing like "strike paragraph 3 and replace with..." with clear, version-controlled comparisons.
Each Markdown file begins with YAML frontmatter containing metadata such as title, identifier, publication date, and status. The project currently includes consolidated state legislation like the Constitution, Organic Laws, and Royal Decree-Laws. Commit messages link to official sources, and the project explicitly states the legislative text is public domain, with the repository's structure and tools under an MIT license. Lopez also hints at a forthcoming API on legalize.dev for programmatic access, comparison, and change notifications, exploring potential business models in legal tech and compliance.
This innovative application of familiar software development tools to the notoriously complex world of legal documentation offers a powerful vision for enhanced transparency and accessibility in legislation.
The Gossip
Git's Grand Global Gambit
Users universally lauded the project as brilliant, a "fantastic work," and a "great idea." Many expressed a desire for similar initiatives across all legislations, highlighting the inefficiency of current legal systems that could be "trivially solved with existing tech frameworks" like Git, envisioning a future where all legal documents are version-controlled.
Legislative Logistical Limbs
While praising the concept, some users discussed how Git could be further adapted or what its limitations are in a legislative context. Suggestions included adding legislative body/voting details to commits (e.g., a form of `git blame` for accountability), breaking down folders by legal categories for easier browsing, and exploring how court judgments could be overlaid onto the history of laws. A humorous observation about a commit dated 2099 also sparked curiosity.
Judicial Jargon Juggle
A significant portion of the discussion revolved around the perceived resistance of the legal industry to technological advancements that could simplify law. Some argued that lawyers actively lobby against efficiency to protect billable hours, while others countered that legal systems often intentionally incorporate subjective terms ("reasonable," "reckless") and depend on context or judicial interpretation (especially in common law systems), making strict formalization difficult. The complexity isn't always trivial to solve, even with advanced tech.
Precedent-Setting Projects
Several commenters pointed out similar projects they had undertaken (e.g., Dutch laws) or official governmental initiatives in other countries (France's Legifrance, Germany's abandoned Bundestag Git repo, Maryland's regs on Open Law Library). This highlighted that the idea isn't entirely new but reinforced the value and general interest in applying version control to legal texts, showing a global movement towards greater legal transparency.