Last active
December 21, 2015 13:59
-
-
Save luan/6316543 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install: