Skip to content

Instantly share code, notes, and snippets.

@creotiv
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save creotiv/45e33723183c1a79d484 to your computer and use it in GitHub Desktop.

Select an option

Save creotiv/45e33723183c1a79d484 to your computer and use it in GitHub Desktop.
Creating change log by git tags
#!/bin/bash
# Author:Andrey Nikishaev
echo "CHANGELOG"
echo ----------------------
git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags |tac |grep -v '^$' | while read TAG ; do
echo
if [ $NEXT ];then
echo [$NEXT]
else
echo "[Current]"
fi
GIT_PAGER=cat git log --no-merges --format=" * %s" $TAG..$NEXT
NEXT=$TAG
done
FIRST=$(git tag -l | head -1)
echo
echo [$FIRST]
GIT_PAGER=cat git log --no-merges --format=" * %s" $FIRST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment