Skip to content

Instantly share code, notes, and snippets.

@jmosbech
Created November 14, 2014 11:35
Show Gist options
  • Save jmosbech/e44bcf59333e6ca4f6fc to your computer and use it in GitHub Desktop.
Save jmosbech/e44bcf59333e6ca4f6fc to your computer and use it in GitHub Desktop.
Find JIRA items in Git commits
#!/bin/sh
RANGE=$1
git log --grep="[A-Z]\+-[0-9]\+" --format=%s $RANGE \
| awk 'match($0, /[A-Z]+-[0-9]+/) {print substr($0, RSTART, RLENGTH)}' \
| sort -t "-" -k1,1 -k2,1n \
| uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment