Skip to content

Instantly share code, notes, and snippets.

@andrewchilds
Last active August 4, 2016 19:43
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 andrewchilds/4217def8e8ad0128240e61605d6bff77 to your computer and use it in GitHub Desktop.
Save andrewchilds/4217def8e8ad0128240e61605d6bff77 to your computer and use it in GitHub Desktop.
Extracting Clubhouse story IDs from a set of git commits
old_sha="87d4fed"
new_sha="2d5b22d"
git log $old_sha..$new_sha --oneline
# 2d5b22d Merge pull request #6 from company/me/ch345/my-story-name
# e730351 Fix bug
# c410ba0 Fix other bug [ch1004]
function clubhouse_find_stories_in_commit_range {
old_sha="$1"
new_sha="$2"
git log $old_sha..$new_sha --oneline | grep -io 'ch[0-9]*' | sed 's/[^0-9]*//g' | uniq
}
clubhouse_find_stories_in_commit_range $old_sha $new_sha
# 345
# 1004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment