Skip to content

Instantly share code, notes, and snippets.

@lfalmeida
Last active June 18, 2018 12:49
Show Gist options
  • Save lfalmeida/53e7528bd08c3fcc2da52fd50babfa65 to your computer and use it in GitHub Desktop.
Save lfalmeida/53e7528bd08c3fcc2da52fd50babfa65 to your computer and use it in GitHub Desktop.
#!/bin/bash
FORMAT='- %s '
SUFFIX='homolog';
echo "## CHANGELOG"
echo ----------------------
git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tac | grep -v '^$' | grep "${SUFFIX}" | while read TAG ;
do
echo -e "\n"
if [ $NEXT ];then
echo "### $NEXT ($(git tag -l --format='%(taggerdate:local)' $TAG))"
echo Release note: $(git tag -l --format='%(contents)' $TAG)
else
echo "### [RC]"
fi
GIT_PAGER=cat git log --no-merges --format="${FORMAT}" $TAG..$NEXT
NEXT=$TAG
done
FIRST=$(git tag -l | grep ${SUFFIX} | head -1)
echo -e "\n"
echo "### $FIRST ($(git tag -l --format='%(taggerdate:local)' $FIRST))"
echo Release note: $(git tag -l --format='%(contents)' $FIRST)
GIT_PAGER=cat git log --no-merges --format="${FORMAT}" $FIRST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment