I put all 8,642 Spanish laws in Git – every reform is a commit

Spain’s laws now scroll like Netflix recaps, and the internet is fighting over who did it first

TLDR: A developer put Spain’s 8,642 laws into a change-tracked repo so every reform shows a clean before/after. Comments cheer its clarity and AI potential, with a side of drama over France “doing it first,” making legal text feel finally searchable and human-friendly.

Spain just got a legal glow-up: developer Enrique López dropped 8,642 national laws into a Git repo — a popular change-tracking tool used by coders — where every reform is a timestamped “commit.” The crowd went wild. The creator himself flexed: “Legislation is patches on patches,” and now you can see actual before/after diffs instead of deciphering “strike paragraph 3” puzzles. Fans cheered, calling it brilliant and begging for every country to copy the move. AI nerds swooped in fast: one said it’s a great way for LLMs (large language models, the brains behind chatbots) to answer law questions more reliably.

But the drama arrived on cue: a commenter shrugged, France did something like this already, sparking a classic internet fight — is this a game-changing innovation or just a slick remix done right? Meanwhile, people joked about “git blame the Constitution” and pretending lawyers now “commit” to reforms. The repo includes the Spanish Constitution, penal code, labor law — all in simple text — plus commit messages that link back to the official BOE source. There’s even a tease of an upcoming Legalize API for alerts when laws change. Verdict from the comments? Whether or not Spain is first, it’s the first time the law feels scrollable, searchable, and actually understandable.

Key Points

  • The project converts Spain’s consolidated state legislation into a Git repository, with each law as a Markdown file and each reform as a Git commit.
  • It includes more than 8,600 laws with complete reform histories since 1960, sourced from the BOE’s Consolidated Legislation API.
  • Each file contains YAML frontmatter with metadata such as title, identifier, publication date, last update, status, and official source link.
  • Commit metadata uses the official publication date and includes the reform identifier and a link to the official source for traceability.
  • An upcoming Legalize API (legalize.dev) will offer programmatic search, filtering, version comparison, and change notifications; legislative text is public domain, while repository structure/tools are MIT-licensed.

Hottest takes

"Legislation is just patches on patches on patches." — enriquelop
"Seems like a great way to have LLMs answer questions about the laws more reliably." — coopykins
"I think French laws have been on website that’s like that for a while" — d--b
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.