scripts/getver.sh: simplify revision calculation

Use git rev-list --count to get the revision number.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
This commit is contained in:
Jonas Gorski 2016-06-04 18:35:21 +02:00
parent c729fe0269
commit 575be9d182

View file

@ -11,7 +11,7 @@ try_version() {
try_git() { try_git() {
git rev-parse --git-dir >/dev/null 2>&1 || return 1 git rev-parse --git-dir >/dev/null 2>&1 || return 1
REV="$(git describe --match reboot | sed "s/reboot-\([0-9]*\)-.*/\1/g")" REV="$(git rev-list reboot..HEAD --count)"
REV="${REV:+r$REV}" REV="${REV:+r$REV}"
[ -n "$REV" ] [ -n "$REV" ]
} }