mirror of
https://github.com/tj/git-extras.git
synced 2026-09-11 07:56:18 -04:00
Use git describe to fetch last tag
This commit is contained in:
parent
2646f387fa
commit
ea7d0dcd92
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue