Skip to content

Instantly share code, notes, and snippets.

@dcadenas
Created February 19, 2014 21:45
Show Gist options
  • Save dcadenas/9102336 to your computer and use it in GitHub Desktop.
Save dcadenas/9102336 to your computer and use it in GitHub Desktop.
Git + pivotal tooling
#!/bin/env bash
# ~/bin/githelpers
pivotal_commit() {
git commit -m "$@ [#$GIT_PIVOTAL_NUM]"
}
pivotal_commit_and_finish() {
git commit -m "$@ [Finishes #$GIT_PIVOTAL_NUM]"
}
pivotal_commit_and_fix() {
git commit -m "$@ [Fix #$GIT_PIVOTAL_NUM]"
}
pivotal_commit_open() {
pivnum=`git log $1 -n1 --oneline --pretty=%s | sed -e 's/^.*\[#\(.*\)\].*$/\1/'`
open https://www.pivotaltracker.com/s/projects/926538/stories/$pivnum
}
---------------------------------------------------------------------------
#.gitconfig
commitpivotal = "!. ~/bin/githelpers && pivotal_commit"
commitpivotalfinish = "!. ~/bin/githelpers && pivotal_commit_and_finish"
commitpivotalfix = "!. ~/bin/githelpers && pivotal_commit_and_fix"
showstory = "!. ~/bin/githelpers && pivotal_commit_open"
-----------------------------------------------------------------
# .bashrc or .zshrc
setpivotalnum() { export GIT_PIVOTAL_NUM=$1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment