Make sure to get the last chronological tag, instead of relying on the bogus git tag sorting.

This commit is contained in:
Guillermo Rauch 2011-03-26 16:00:50 -07:00 committed by Tj Holowaychuk
parent 1304fdc924
commit 27e8049fd7

View file

@ -6,7 +6,8 @@ DATE=`date +'%Y-%m-%d'`
HEAD="\nn.n.n / $DATE \n==================\n"
if test "$1" = "--list"; then
version=`git tag | tail -n 1`
version=`git for-each-ref refs/tags --sort=-authordate --format='%(refname)' \
--count=1 | sed 's/^refs\/tags\///'`
if test -z "$version"; then
git log --pretty="format: * %s"
else
@ -20,4 +21,4 @@ else
if [ -f $CHANGELOG ]; then cat $CHANGELOG >> $tmp; fi
mv $tmp $CHANGELOG
test -n "$EDITOR" && $EDITOR $CHANGELOG
fi
fi