Created
February 6, 2015 06:40
-
-
Save xcodebuild/240b25be2fb9e24f11ba to your computer and use it in GitHub Desktop.
changelog.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: tim.tang | |
rm -f changelog.md | |
git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | grep -v '^$' | tail -r | while read TAG ; do | |
echo | |
if [ $NEXT ];then | |
echo ' ' >> changelog.md | |
echo *$NEXT* >> changelog.md | |
echo '---' >> changelog.md | |
else | |
echo ' ' >> changelog.md | |
echo *CURRENT* >> changelog.md | |
echo '---' >> changelog.md | |
fi | |
echo ' ' >> changelog.md | |
GIT_PAGER=cat git log --no-merges --date=short --pretty=format:'- %ad (%an) %s -> [view commit](https://github.com/xplusz/smartbus-nodejs/commit/%H)' $TAG..$NEXT >> changelog.md | |
echo ' ' >> changelog.md | |
NEXT=$TAG | |
done | |
echo "DONE." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment