[source] scripts/getver.sh: simplify revision calculation

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 9 04:43:41 PDT 2016


jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=575be9d18259560b40039ee0e4bf6d6ce109fca6

commit 575be9d18259560b40039ee0e4bf6d6ce109fca6
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Jun 4 18:35:21 2016 +0200

    scripts/getver.sh: simplify revision calculation
    
    Use git rev-list --count to get the revision number.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 scripts/getver.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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" ]
 }



More information about the lede-commits mailing list