Skip to content

Instantly share code, notes, and snippets.

@WimObiwan
Last active May 29, 2017 12:00
Show Gist options
  • Save WimObiwan/17d353b1f292e3f199e57ebc6f040c64 to your computer and use it in GitHub Desktop.
Save WimObiwan/17d353b1f292e3f199e57ebc6f040c64 to your computer and use it in GitHub Desktop.
$match = 'CTArchitect-*'
git branch | %{ $_ -replace '^[* ] ([^ ]*$)', '$1' } | ?{ $_ -match '^(Version-.*)|(master)$' } | %{ git describe --match $match $_ }
$contains=''
git branch --contains $contains | %{ $_ -replace '^[* ] ([^ ]*$)', '$1' } | ?{ $_ -match '^(Version-.*)|(master)$' } | %{ git describe --match $match $_ }
git branch -r --contains $contains | %{ $_ -replace '^[* ] ([^ ]*)(?: -> .*)?$', '$1' } | ?{ $_ -match '^(?:.*/)?(Version-.*)|(master)$' } | %{ git describe --match $match $_ }
git tag --contains $contains | Group-Object { $_ -replace '^(.*-v?\d+\.\d+\.\d+)\.\d+$', '$1' } | Where-Object { $_.Name -like $match } | %{ $_.Group[$_.Group.Count - 1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment