summaryrefslogtreecommitdiff
path: root/scripts/getver.sh
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2016-06-04 18:35:21 +0200
committerJonas Gorski <jonas.gorski@gmail.com>2016-07-09 13:41:28 +0200
commit575be9d18259560b40039ee0e4bf6d6ce109fca6 (patch)
tree0936a8d840a37530a3d89c1de195189fcc6e4cce /scripts/getver.sh
parentc729fe02694a583d38ef6636837fce4b4b6fa8e8 (diff)
downloadmtk-20170518-575be9d18259560b40039ee0e4bf6d6ce109fca6.zip
mtk-20170518-575be9d18259560b40039ee0e4bf6d6ce109fca6.tar.gz
mtk-20170518-575be9d18259560b40039ee0e4bf6d6ce109fca6.tar.bz2
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>
Diffstat (limited to 'scripts/getver.sh')
-rwxr-xr-xscripts/getver.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/getver.sh b/scripts/getver.sh
index d091671..340ed68 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -11,7 +11,7 @@ try_version() {
try_git() {
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}"
[ -n "$REV" ]
}