Last active
September 25, 2015 01:46
-
-
Save igrep/8ce6cbc3aec9e99b1993 to your computer and use it in GitHub Desktop.
branch名にuser storyのidを入れてコミットメッセージにuser storyのURLを自動で貼る ref: http://qiita.com/igrep/items/17df4627192d7d9d3188
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
| #!/bin/sh | |
| story_id=$(git rev-parse --abbrev-ref HEAD | sed -n 's#.*stories/\([0-9]\+\).*#\1#p') | |
| if [ -n "$story_id" ]; then | |
| echo user story: https://www.pivotaltracker.com/story/show/$story_id >> $1 | |
| fi |
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
| $ git checkout -b stories/123456789 |
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
| $ chmod +x .git/hooks/commit-msg |
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
| $ chmod +x .git/hooks/prepare-commit-msg |
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
| #!/bin/bash | |
| story_id=$(git rev-parse --abbrev-ref HEAD | sed -n 's#.*stories/\([0-9]\+\).*#\1#p') | |
| story_url=https://www.pivotaltracker.com/story/show/$story_id | |
| if [ -n "$story_id" ] && ! grep --quiet -e $story_url $1 ; then | |
| echo >> $1 | |
| echo user story: $story_url >> $1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment