mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Merge pull request #126 from agrimaldi/fix-changelog-last-tag
Use git describe to fetch last tag in git-changelog
This commit is contained in:
commit
60f8371d55
|
|
@ -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