Use git describe to fetch last tag

This commit is contained in:
Alexis GRIMALDI 2012-07-16 16:52:13 +02:00
parent 2646f387fa
commit ea7d0dcd92

View file

@ -5,8 +5,7 @@ HEAD="\nn.n.n / $DATE \n==================\n\n"
case "$1" in
-l|--list)
version=`git for-each-ref refs/tags --sort=-authordate --format='%(refname)' \
--count=1 | sed 's/^refs\/tags\///'`
version=$(git describe --tags --abbrev=0 $(git rev-list --tags --max-count=1))
if test -z "$version"; then
git log --pretty="format: * %s"
else
@ -27,4 +26,4 @@ case "$1" in
mv $tmp $CHANGELOG
test -n "$EDITOR" && $EDITOR $CHANGELOG
;;
esac
esac