This article explains how I built a Git repository of Chile's entire legal code: more than 300,000 laws, decrees and resolutions in a corpus that reaches back to 1810, with one commit per legislative publication, so the text of any law can be read as it stood on any date. It covers scraping the Biblioteca del Congreso Nacional (BCN) and LeyChile, building the history with git fast-import, the limits of Git and GitHub that the repository hit, and the web UI, API and MCP server built on top of it. The repository is pisanvs/ley-chile , and you can browse it at leyes.pisanvs.cl .
Why Version Control for Legislation?
I think most programmers would agree that working—in a team—without a version control system like Git, is as horrifying as ripping your nails out with bare hands.…