Watching the evolution of law over time is a fascinating thing and using SW engineering tools to help would be really fun.
Watching the evolution of law over time is a fascinating thing and using SW engineering tools to help would be really fun.
https://github.com/divegeek/uscode
The diffs are huge.
Example: https://github.com/divegeek/uscode/commit/1fb2d83137dad1c6ca...
What's happened is that "Section 2" was moved later in the sentence, abbreviated as "Sec. 2", "of" was deleted, and "act" was capitalized:
Section 2 of act July 30, 1947, ch. 392, 61 Stat. 674, provided...
Act July 30, 1947, ch. 392, Sec. 2, 61 Stat. 674, provided...
The rest of the paragraph is unchanged, but git shows a 6-line diff with the entire paragraph replaced. GitHub attempts to do some word-based highlighting (see the timestamp lines), but it falls down on most of these paragraphs. Wikipedia's diffing tends to work better for this kind of thing; I'm not sure what they use. The upshot is that the number of lines changed may be a 5-10x overestimate.You can do word diffs with git:
git diff --word-diff=colorSee diff.c line 793 for how it works.
Test the first. This will check if reflowing
text actually produces git word-diff weirdness,
or if it's actually decent.
The line does get reproduced on the terminal (a line diff was seen), but no text is shown in green or red to indicate an actual change. [-Section 2 of act-]{+Act+} July 30, 1947, ch. 392, {+Sec. 2,+} 61 Stat. 674, provided that
Wonder if there's a way to enable that behavior on GitHub? And/or to generate repository activity statistics based on changed words rather than changed lines?as far as words in lines, you do have a point.
That is, the law that they enact says "This law is to do blah blah blah.
Subsection 1373(a) of the US code is replaced with the following text 'blah blah blah'"
The wording used is pretty standard. So you can actually parse it in most cases to see what the actual changes are.
If nothing prevents you, you ought to throw this up for others to see. Worst comes to worst, no one finds it useful.
I'd be surprised if we couldn't write a parser for bills to produce more efficient diffs.
https://github.com/bundestag/gesetze/commit/f90e8fc8eb20f081...
(see also: https://news.ycombinator.com/item?id=6137337)
I'd love to `git blame` the U.S. code.
"When sections are repealed, their text is deleted and replaced by a note summarizing what used to be there." https://en.wikipedia.org/wiki/United_States_Code#Treatment_o...
"Remove pages 123.4 - 123.6 and replace with pages 123.4a-123.7."
Later, when I learned about diffs, I understood the concept immediately.
See: http://en.wikipedia.org/wiki/United_States_Code#Legal_status
Someone needs to take the plunge and start writing the program; throw it on Github and tell us all about it. I know people who are looking for such a tool.
I'd do it myself but I'm already neck deep in work and volunteer projects outside of work.
There is a link to the schema used and a stylesheet (I assume for the xhmtl maybe?) that I would like to add in. But one step at a time.