Skip to content

Change story state in pivotal tracker from git commit messages. Tie git commit message as comments on pivotal tracker stories.

Notifications You must be signed in to change notification settings

bendycode/tracker-git-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tracker-git-hook

Example Usage

  1. git commit -am "[Story467593 state:finished] My super duper comment."
  2. git push

Story 467593 on Pivotal Tracker is now marked finished, and has “My super duper comment”. Your git commit has been tied to Pivotal Tracker just like that.

Overview

Use this project so that commit messages pushed to your non-github git server automatically post as comments tied to your Pivotal Tracker stories, and can also change the state of those stories.

This is very handy way to tie your git history to your Pivotal Tracker history.

If your project lives on github, use tracker-github-hooks. If you use Lighthouse, then use lighthouse-git-hooks instead. Those projects inspired this one, and in all honesty, this project is as much a fork of lighthouse-git-hooks as not.

If you want to use this, and desire functionality not yet in place, then fork away! It is open source, after all.

Installation and Configuration

Install tracker-git-hook (One Time Only)

  1. log into your git server, probably as the git user, in git’s home directory
  2. If you use Ubuntu, you must have libxml2-dev and libxslt1-dev packages installed (for nokogiri)
  3. sudo gem install hpricot mime-types archive-tar-minitar nokogiri hoe rcov diff-lcs (sorry for the giant list o’ dependencies!)
  4. git clone git://github.com/bendycode/tracker-git-hook.git
  5. cd tracker-git-hook
  6. export TRACKER_GIT_HOOK_HOME=$(pwd)
  7. git submodule init
  8. git submodule update

Configure a project

  1. cd into your project’s hook directory
    • For me, this was in ~git/repositories/project_name/hooks
    • It might also be in ~git/repositories/project_name/.git/hooks
  2. mv post-receive post-receive.original
  3. cp $TRACKER_GIT_HOOK_HOME/hooks/post-receive.sample ./post-receive
    • Your file must be executable at this point.
  4. edit the new copy of post-receive:
    • set TRACKER_GIT_HOOK_HOME to the same directory you set it to when installing tracker-git-hook above.
    • set your PROJECT_NAME
  5. cd $TRACKER_GIT_HOOK_HOME/project_configs
  6. cp -r sample your_project_name
  7. edit your new project config directory.
    • Note that I have set .gitignore to keep your (and my) project config settings out of github.
  8. cd users
  9. copy login\@example.com for each of your users & edit as appropriate

Try it out

  • Try the syntax shown above, but for a story number in your project.
  • If everything worked, then party! You’re good to go.
  • If there are errors, then:
    1. Don’t panic. They occur in the POST-receive hook, so your git commit still worked. This project will not mess up your commits.
    2. Calmly read the error messages. There should be line numbers from the post-receive hook.
    3. Figure out the answer, fix it, and send me a README enhancement, or a patch, so this will be better for the next person (perhaps you, on your next project!)

Enjoy!

  • Once this is in place, and working, then you can simply enjoy having your git commits tied to Pivotal Tracker. W00t!

License MIT

© 2009 bendycode
© 2008 Antonin Amand (author of lighthouse git hooks that this is forked from)

About

Change story state in pivotal tracker from git commit messages. Tie git commit message as comments on pivotal tracker stories.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages