Home My First Greasemonkey Script
Post
Cancel

My First Greasemonkey Script

Link Github Commit to Pivotal Tracker Story

I’m using Github and Pivotal Tracker. You can easily configure Github to notify Pivotal Tracker of commits. Once you have done that, then whenever you want to commit something that is related to a story you simply embed the tracker story id in your commit message. Something like:

> git commit -m "[#87654321] Finish the new story"

It’s necessary that you put it in square brackets and use the pound sign. If you do this, then a comment will be added to your Pivotal Tracker story with a url that links back to the commit. This is cool.

However, this doesn’t generate any link from Github to Pivotal Tracker. Sure you could either a) copy the story id and switch over to Pivotal Tracker and do a search or b) embed the URL every time you do a commit.

But there is something easier you can do. You can install my new Greasemonkey script. (This works in Firefox if you have Greasemonkey installed, and it works in Chrome natively.)

For easy install you can go to http://userscripts.org to install my script.

Link a commit to its tracker story

The code is stored in a gist at Github (Note, this gist may have been updated since this post was written. Click thru to see the latest):

Here’s a screenshot of my commits in my mbasic99 project. The most recent commit was related to a story on Pivotal Tracker.

Shows Pivotal Tracker icon and URL to Pivotal Tracker

The Pivotal Tracker icon links back to the story identified in the commit.

This post is licensed under CC BY 4.0 by the author.

Brainmess: Extract Tape Class

Basic Compiler: A Great Refactoring Opportunity