Skip to content

Instantly share code, notes, and snippets.

@cezarypiatekGC
Last active February 25, 2020 09:48
Show Gist options
  • Save cezarypiatekGC/0a6b7ab3fd8a81471fc292de95e3bae4 to your computer and use it in GitHub Desktop.
Save cezarypiatekGC/0a6b7ab3fd8a81471fc292de95e3bae4 to your computer and use it in GitHub Desktop.
$parents = $(git log --pretty=%P -n 1) -split '\s'
$messages = git log --pretty=%s "$($parents[0])...$($parents[1])"
foreach($message in $messages)
{
if($message -NotMatch "^[a-z]+-[0-9]+:")
{
Write-Error "Commit message missing JIRA prefix: $message"
}else
{
Write-Host "Message ok: $message"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment