Skip to content

Instantly share code, notes, and snippets.

@samiron
Last active August 24, 2022 12:42
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 samiron/5d02ea6d932be299247c52f29105e352 to your computer and use it in GitHub Desktop.
Save samiron/5d02ea6d932be299247c52f29105e352 to your computer and use it in GitHub Desktop.
find jira items since the last tag
#!/bin/sh
# Usage:
# ./release-items.sh last-release-tag jira_number_prefix [-v]
jira_prefix=$1
since_tag=$2
if [ -z "$3" ]; then
lines=$(git log --oneline --first-parent "$since_tag"..HEAD | cut -d ' ' -f 5- | sed -nE "s/.*((:?${jira_prefix})\-[0-9]{3,6}).*/\1/p")
else
lines=$(git log --oneline --first-parent "$since_tag"..HEAD | cut -d ' ' -f 5- | grep "${jira_prefix}\-")
fi
printf "\n\nNumber of items in release:"
echo "$lines" | wc -l
printf "\n%s\n" "$lines";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment