M

Team Coding In (Kind Of) Real Time

June 28, 2013 — 1 minute long

The other day a co-worker had an idea: “Wouldn’t it be cool if our IRC bot would notify us when people commit? Not just when they push, but when they commit locally.” Yeah, that would be cool.

So I wrote a simple commit-listening server in Clojure using Compojure and ring-jetty-adapter. It hooks into our existing IRC bot (also written in Clojure), which we have running on an internal server. A really simple git hook runs on post-commit. So now, anytime anyone on our team commits locally to one of our projects we get a nice message from the bot:

Michael Hanson in scada/feature-opc-server: "Add most of OPC's deps" (8d6c981)

That’s the committer, the project and branch names, the commit message and the SHA-1 hash.

We’ve been using this for a few weeks, and it has really helped us not to step on each other’s toes. I can see a coworker committing code that may affect what I’m working on, and we can talk about it fast, instead of waiting for a merge conflict later.

You can check out pgbot on GitHub.