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

This reverts commit f659f34375.
This commit is contained in:
Tj Holowaychuk 2011-03-28 12:31:39 -07:00
parent f659f34375
commit 3315c8e19a

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