Keep track of your Git commits using RescueTime Highlight Events

I spend a significant chunk of my work day writing code. Some of that is building new features, some of it is fixing bugs, and still more of it is going back to refactor something I sloppily threw together earlier. I’m doing a lot of different things, and it’s often hard to remember them all.

Luckily, Git forces me to leave a log message about what I’ve changed with each commit. It’s a good audit trail. If anything ever goes wrong, we can usually roll back through the Git commit logs and easily figure out the likely culprit.

But commit messages represent something more than just a way to make code rollbacks easier. They’re also a pretty useful document of how I spent my time. Reviewing the contents of git log is pretty clunky, so we just added a way to easily import your git commit messages into RescueTime Premium as highlight events.

commit-highlights-example

Adding commit logs to my Highlights stream helps me understand my software development time better. Was I working on the right things? Did the amount of time I spent coding that day really make sense compared to what I actually checked in? When I get really busy, work becomes a blur, so it’s nice to have an easy list to review at the end of the week and remind me that, yes, I actually did accomplish some stuff. 🙂

They’re also really useful alongside the rest of my highlight events, so I can see how all my activities are lining up and if I’m neglecting anything. I use different labels to group commits for different projects, so I can see how often I’m committing code for the RescueTime web site, the browser extension, or any of our other projects.

How to log your own Git commits as RescueTime Highlights:

  1. Make sure you have RescueTime Premium. You will need it to post highlights.
  2. Go to our Git integration page and generate a post-commit hook file. You can customize the highlight label (‘code commit’ vs. ‘website project commit’, vs. etc…), and choose whether or not to ignore commit messages less than 20 characters. I do this so I can skip over commit messages like “oops, typo”.
  3. Save the generated file in your Git project’s .git/hooks directory
  4. Give the file executable permissions (chmod +x post-commit)
My commit history on my RescueTime dashboard

My commit history on my RescueTime dashboard

That’s it! All future commits will automatically be logged as highlight events in RescueTime and will show up on your dashboard and the weekly email reports. It’s just one more way you can save yourself some typing and still keep a rich record of your accomplishments.

What do you think?


4 Comments on “Keep track of your Git commits using RescueTime Highlight Events”

  1. dreeves says:

    So good! Just wanted to also mention our vaguely similar http://gitminder.com

  2. Taylor says:

    This is great… now tell me more about those other categories next to your commits! I assume you have a hook somewhere between your to-do tracker and RT’s API? Do you use IFTTT for this, Zapier, or a custom script? For point of reference, I use Todoist.

    Also, does anyone on your team use Toggl together with RescueTime? I use it to track my discrete time entries, and those go into a Google spreadsheet. I log highlights in RT manually. And RT’s summary goes into that spreadsheet too. But I’ve yet to find a way to send RT’s details into a spreadsheet, so I never log time in there manually.

    • Robby Macdonell says:

      Most of the other ones are getting pulled in via Zapier. You can read more about some of them here: http://blog.rescuetime.com/2015/01/27/how-i-use-trello-zapier-and-rescuetime-to-keep-track-of-what-ive-been-doing/

      I believe Zapier has support for Todoist, so it can be used similarly to how I described using Trello.

      As for Toggl, I’m a little unclear on what you’re asking? None of us use it right now. I used to a while ago, until I realized I’m just really bad at remembering to keep up with it – something I should perhaps revisit now that we have better reminder support in RescueTime. Would you like to see RescueTime data logged in Toggl? Or vice versa? We’re actually planning on taking a closer look at Toggl, Harvest, etc here in the next few months to see what kind of integrations we can put together. Still a lot of investigation to do there, though.

  3. Javier says:

    Interesting feature. How does this work with rebases? Because when you rebase, your commit time gets update to “now”, basically. Won’t that screw the information that gets pushed to RescueTime?