From ea7d0dcd92f5bc3fcbf5db6fd507f6d4a6d37e51 Mon Sep 17 00:00:00 2001 From: Alexis GRIMALDI Date: Mon, 16 Jul 2012 16:52:13 +0200 Subject: [PATCH] Use git describe to fetch last tag --- bin/git-changelog | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/git-changelog b/bin/git-changelog index 28cda0e..af602ce 100755 --- a/bin/git-changelog +++ b/bin/git-changelog @@ -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 \ No newline at end of file +esac