Skip to content

Instantly share code, notes, and snippets.

@rastasheep
Forked from JoelBesada/README.md
Last active August 29, 2015 13:57
Show Gist options
  • Save rastasheep/9407768 to your computer and use it in GitHub Desktop.
Save rastasheep/9407768 to your computer and use it in GitHub Desktop.
Pivotal Tracker commit message bookmarklet for Backtick

Bookmarklet to generate a commit message with Pivotal Tracker story ID and title

For clarity and traceability, your commit messages should include the ID and title of the Pivotal Tracker story you're working on. For example:

[#12345] Add Google Maps to user profiles

When you now open one ore more story in Pivotal Tracker and hit the bookmarklet, it will display a prompt with a commit message. You can also select the stories using the blue box next to them.


Original source

javascript:(function($) { var storyTitles = []; var stories = $('.story .selector.selected').closest('.story'); var collapsed = true; if (stories.length == 0) { stories = $('.story .details').closest('.story'); collapsed = false; } stories.each(function() { var story = $(this); var title = (collapsed ? story.find('.story_name').text() : story.find('.editor.name').val()); var id = /story_(\d+)/.exec(story.attr('class'))[1]; var gitptTitle = '[#' + id + '] ' + title; if (storyTitles.indexOf(gitptTitle) == -1) { storyTitles.push(gitptTitle); } }); if (storyTitles.length > 0) { prompt('Your commit message:', storyTitles.join('; ')); } else { alert("Please select the stories first."); } })(jQuery);pt
{
"name": "Pivotal Tracker Commit Message",
"description": "Generate a commit message with Pivotal Tracker story ID and title",
"icon": "https://backtickio.s3.amazonaws.com/icons/backtick.png",
"link": "https://www.pivotaltracker.com"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment