Commit 80d06b0c authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Determine latest tag using git describe.

Commit 8648db83 relies on `sort -V` which is unavailable on some
platforms.  Instead just use `git describe` with --abbrev=0 to only
output the tag.  We still manually compute the distance to avoid the
problem mentioned in that commit.

Additionally, add Vincent's fix from commit 3b142cea to the stable
branch.
parent 8e0d8616
......@@ -5,7 +5,7 @@
# This would generate based on the last update of the ChangeLog, instead:
# lrev=$(git log -1 --pretty=format:"%H" ChangeLog)
lrev=$(git tag --merged=HEAD --list 'mutt-*-rel' | tr - . | sort -Vr | head -n1 | tr . -)
lrev=$(git describe --tags --match 'mutt-*-rel' --abbrev=0)
# This is a rough approximation of the official ChangeLog format
# previously generated by hg. Git doesn't provide enough formatting
......
......@@ -7,10 +7,10 @@ srcdir=`dirname "$0"` && cd "$srcdir" || exit 1
# Ensure that we have a repo here.
# If not, just cat the VERSION file; it contains the latest release number.
{ [ -d ".git" ] && command -v git >/dev/null 2>&1; } \
{ [ -e ".git" ] && command -v git >/dev/null 2>&1; } \
|| exec cat VERSION
latesttag="$(git tag --merged=HEAD --list 'mutt-*-rel' | tr - . | sort -Vr | head -n1 | tr . -)"
latesttag="$(git describe --tags --match 'mutt-*-rel' --abbrev=0)"
version="$(echo $latesttag | sed -e s/mutt-// -e s/-rel// -e s/-/./g)"
distance="$(git rev-list --count $latesttag..)"
commitid="$(git rev-parse --short HEAD)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment