Reading Glasses

I’ll level with you: I’m not very good at reading code.

I had an interview the other day that featured the dreaded read-this-code segment that’s inevitable in modernity, and reading somebody else’s Python without context, with a regex or two thrown in for kicks… I know there are people who can do that really well, but man, I’m not one of them.

To try and atone for how that went, I’ve written a thing I’ve been meaning to get done for a while, a kind of high-level analysis tool for Git repositories that will be able to give you some suggestions based on historical commit information. It’s called gitcoach, and it’s over on github if you’re interested.

The idea is that it takes look at a project’s whole commit history to see what files tend to get modified at the same time and then looks at what you’re working on now; if you’re working on some file Foo, gitcoach can tell that hey, historically anyone who’s had to change Foo has also changed Bar 92% of the time, and Baz 80% of the time. So, no guarantees, but I suggest you look at those too.

There’s more you can do with that data, perhaps obviously – the nice thing about the general idea is that whenever I mention it to somebody, they think of some other thing you can do with that data that I hadn’t even considered.

So that’s something.

It’s not a finished product – there’s some known bugs and missing features listed in the README, and some others I’m sure that I don’t see yet. But there it is, and hopefully it will be useful for people trying to find their way around a big or new projects.

Sorry about the regex question, dude.

2 Comments

  1. Posted December 14, 2012 at 10:45 pm | Permalink

    Huh, that looks similar to something I hacked up a while ago, but my version was for hg repos…
    https://github.com/bwinton/Mozilla-Tools/tree/master/file-clusterer

    I wonder if having something like that running for the Mozilla codebase as a web service would be a useful addition to bugzilla.js? (“I see you’re attaching a patch. You might consider also changing this file before posting it… Oh, and you have trailing whitespace on line 53 of foo.cpp.” :)

    Later,
    Blake.

  2. Posted December 14, 2012 at 10:47 pm | Permalink

    (Oh, and I forgot to mention that I got the idea from one of Greg Wilson’s books. “Making Software”, probably. If you want to borrow my copy to read for future ideas, let me know. ;)