Skip to content

Instantly share code, notes, and snippets.

@vgebrev
Created June 11, 2020 12:45
Show Gist options
  • Save vgebrev/98776ea0ee13a81127ae309d38d560b1 to your computer and use it in GitHub Desktop.
Save vgebrev/98776ea0ee13a81127ae309d38d560b1 to your computer and use it in GitHub Desktop.
PowerShell script that lists all distinct JIRA task codes from commit messages since the last tag
$jiraTaskPattern = 'XXX-\d{1,4}'
$latestTaggedCommit = git rev-list --tags --max-count=1
$latestTag = git describe $latestTaggedCommit
git log --pretty=oneline "$latestTag..HEAD" | Select-String -Pattern $jiraTaskPattern | ForEach-Object { $_.Matches[0].Value } | Group-Object | ForEach-Object { $_.Name } | Sort-Object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment