One difficult challenge is that text-line based diffs don't work well for free-form text documents. Line length, line breaks, paragraph breaks, list formatting, etc. are very ad-hoc in most legal documents.
I think software engineers- thanks to much faster iteration cycles and having clarity and order as their only concern- have developed solutions and practices that absolutely can and should be applied also to the management of the law.
My understanding is that there are always administrative departments responsible for updating and publishing the statutes based on the bills that have been passed. This is effectively applying a patch approved by the legislative process to the repository of statutes.
If you try to dig into a mainstream news story about legislative actions to the actual bill text you'll quickly find that for all but the simplest actions the bill text is useless for understanding the effect of the bill. The problem is that you need the surrounding context of the statute or regulation that is being amended in order to understand. At least for my state and the US federal legislative systems, the web based UI for understanding all this is abysmal.
The cynic in me thinks that legislators don't even understand the true nature of their own legislation. They are making voting decisions based on staff summaries, verbal discussions, media reports, constituent sentiment analysis, etc.
I don't think that's the case in Italy. A bill often takes the takes the form of sequences such as "in the bill n. 1234/05 at the subparagraph 2, the word X is replaced with the word Y." There isn't, to my knowledge, a notion of "document" which the patch is applied to. You can, of course, derive the documents from the successive patches, and laws on new matters contain an entire document as a "first commit". But in software engineering it's the documents/ files you care about, patches and commits only exist as a support for change management.
This seems like it should be done by some government department, but if it's not, still a lucrative opportunity for the private sector (surely every lawyer would buy a copy /subscribe to your service).
For example, here is a collection of "Statement of changes in Immigration Rules: 1994 to 2020": https://www.gov.uk/government/collections/immigration-rules-...
If you click on the latest document, "accessible" version, you'll find paragraphs such as the following:
Changes to the Introduction
Intro1. In paragraph 6.2, after the definition of “English language course”, insert:
“ “EU national” in Appendix T5 (Temporary Worker) International
Agreement Worker means a person who is a national of: Austria, Belgium,
Bulgaria, Croatia, Republic of Cyprus, Czech Republic, Denmark, Estonia,
Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania,
Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia,
Slovenia, Spain, or Sweden; and who is not also a British citizen.”.
Changes to Part 7
7.1. For the second paragraph 276BB1(vi)(d), substitute:
“(e) the Ministry of Defence, the Foreign and Commonwealth Office, the
Department for International Development or the Foreign, Commonwealth
and Development Office has determined should qualify for relocation under
the ex-gratia redundancy / resignation package, including confirmation that
they served ‘on frontline duties outside the wire in Helmand’.”.
Anyone interpreting this law (i.e. lawyers) does not have the "latest" version to hand; they have to stack successive changes.There are other complications, which I can't recall, but I dearly wish someone would do this for UK law.
There was a lot of media noise about this bill, and it was frustratingly difficult to figure out what it actually did.