I remember reading about someone simply adding legal texts to git. This is pretty much useless. I think that people who do this never saw a commercial legal database (or how it is called).
What one usually need, is for example, to have cross-references, i.e. when a law contains phrase like "the certification is issued by a relevant authority", you want to have the "relevant authority" wrapped in a hyperlink pointing to an government order that designates that authority. Also, you typically want to have links to court cases related to some paragraph near it etc. If some change is planned to the law you want to have a note in the text like "this is going to change on September, 1", etc.
Given that many countries have local laws, you might want to be able to filter by a place.
Github might be used for storing raw documents as some weird kind of a database, but it is useless for actually trying to find out the answers to legal questions.
To make an analogy, reading laws on Github is like reading source code without syntax highlighting and navigation.
I have once used git to track proposed changes to existing legal texts - it was very helpful for that already.
I think the main thing you'd want to do to make git useful for human readable text, like laws or a novel, is to put each sentence on its own line.
By default, git's diff and merge want lines-of-code to be meaningful and are set up for that.
There's always git diff --word-diff, so a website tracking changes in laws in a Git repo could display diffs using that flag by default.
Yes.
Or you can write your own diff (and merge) driver and plug it in, git is flexible enough for that. At least in theory. The original idea was mostly to offer that to help with eg tracking of binary formats.
I'm not sure this feature is actually widely used enough to have gotten enough polish to be useful.
So in practice you might be better off changing your data format slightly, to make lines-of-text a meaningful thing, and then use git mostly as is.
Isn’t that a different concern?
Technically yes, but you can see below that there are several comments about exactly this, i.e. adding raw legal texts into git.
Code bases have a lot of cross-references as well. Perhaps the most easily described is 'jump to definition'. But that's handled by your IDE/editor together with language specific tooling, and has nothing to do with git.
Why should legal texts be any different as far as git is concerned?
Git/github doesn' provide "Go to definition" and original post was about uselessness of committing law texts into git.
Let's leave github out of the discussion. That's a completely different beast. (And funny enough, github does provide 'go to definition' for some languages.)
So my point was that git is obviously useful for source code of programs.
And as you point out, git does not provide 'go to definition' for source code of programs.
Hence I suggest that the inability of git to provide cross-references in legal text is about as relevant (or rather irrelevant) to the discussion at hand as git's inability to provide cross-references is source code.
Does this make sense?
Git is unnecessary here anyway.
Git is useful for collaboration of multiple people on the same project. Is law making a collaboration? Typically there is a single person which signs the bill into a law. But there is collaboration during work on the bill, though.
But I do not think that people who make laws want to write git commands in the console. They want the GUI (ideally integrated into Microsoft Word). And if we are making GUI why not drop git and use a traditional relational database for storing the data?
Git is useful for a single person, too.
You are right that the default UI of git is intimidating for normal people.
Saying 'relational database' says about as much about how you actually store the data as saying 'json' or 'xml'. Yes, you could use a variant of git that stores all its information in a relation database. (And in a saner parallel universe, git might have used something like sqlite internally, instead of hand-rolling its own formats from scratch.)
But the question of UI is pretty much independent from the question of how you want to store the data.
iirc some european countries are currently exploring the idea of "law as code", i.e. law in a machine-readable format that can be parsed algorithmically. iirc austria already made some progress by converting some of their lawbooks to such a format. (I remember being in a presentation about that topic, and I explicitly asked about some actual laws being converted, and they actually showed some of these laws, but I can not find publicly available sources I could link, except some general corporate statements like this https://wwwdev.unisys.com/our-clients/advancing-public-servi... ). EU seems to work on something similar, e.g. https://interoperable-europe.ec.europa.eu/collection/endorse...