divegeek / uscode

The United States Code
http://uscode.house.gov/download/download.shtml
806 stars 57 forks source link

More descriptive commit messages #2

Open darconeous opened 13 years ago

darconeous commented 13 years ago

It would be great if the commit messages could contain a brief explanation of what sections changed. Perhaps like...

Updates titles 07, 08, and 11

or, in cases where minor changes are made to one of the titles, (like with this commit) you could summarize this way:

Updates title 11, minor changes to title 09

The later is a little more difficult, but it could help readability.

Kwpolska commented 13 years ago

It's done automatically, so it would be problematic. You can see the changes in /code/.

divegeek commented 13 years ago

It's a good point, though, and it seems like it wouldn't be too difficult to examine the diff and generate a summary of which sections changed. I'll look at it when I get some time.

williscool commented 12 years ago

I agree with this.

Someone should start a company to get some legislative official to fork it and maintain it. You know like an olive branch to the development community.

And yes this is one of those hand wavy "someone not me" comments :)

cayblood commented 12 years ago

I think it would be awesome to be able to see commit messages from the person actually responsible for the change. I think github does gravatars even for people who aren't registered users. Perhaps someone could create gravatars with publicly available photos of the relevant legislator.

cooljeanius commented 11 years ago

It's a good point, though, and it seems like it wouldn't be too difficult to examine the diff and generate a summary of which sections changed.

It'd probably be easier with the xml version of the code, but with the text version of the code, how about this:

  1. grep for a newline followed by a + or a - (That's what diffs use to show what changed)
  2. return the line number for all lines matched like this; these are your "changes"
  3. grep for section headings and return the relevant ones' line numbers
  4. for each set of changes, return the section heading immediately preceding (in terms of line numbers) that set of changes, including that section heading's number
  5. for each section heading number returned, include it in the commit message