Skip to content

Instantly share code, notes, and snippets.

@luan
Last active December 21, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luan/6316543 to your computer and use it in GitHub Desktop.
Save luan/6316543 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
function get_story()
{
curl -X GET -H "X-TrackerToken: $TOKEN" "https://www.pivotaltracker.com/services/v5/projects/$PROJECT_ID/stories/$1" 2>/dev/null
}
stories=`git log $1 | egrep -o "\[\w* ?#(\d+)\]" | egrep -o "\d+" | sort -u`
for story_id in $stories; do
echo -n "[#$story_id] - "
state=`get_story $story_id |
egrep -o "\"current_state\": \"(.*)\"" |
cut -d":" -f2`
if [ -z "$state" ]; then
state='"not found"'
fi
echo $state
done
#!/usr/bin/env bash
TMP_DIR=/tmp/
cd $TMP_DIR
curl -sO https://gist.github.com/luan/6316543/raw/90a05693e35d69cbd33cc6f120b7e64b1e17582c/git-stories.bash
mv git-stories.bash /usr/local/bin/git-stories
chmod a+x /usr/local/bin/git-stories
@luan
Copy link
Author

luan commented Aug 23, 2013

Install:

\curl https://gist.github.com/luan/6316543/raw/7edfd848bcdd8e7f9be854cbbe032f773374f1d6/install.bash | bash -s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment