From d01001bfac68aa1e489b842001799b4cea3a6bd5 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Tue, 11 Oct 2016 12:20:15 +0300 Subject: [PATCH] scripts/getver.sh: Fix revision numbering (for Github-based repo) Fix Chaos Calmer revision numbering. CC has been stuck at r49389 since the final move to Github as revision number evaluation has still been based on git-svn-id that is not found in the new original Github commits. So the revision has been stuck at last svn commit in June. This patch * copies the git revision logic from master and uses v15.05.1 tag as the base. As the last commit with a known svn revision 49389 was cb4f071 with tag+135, use 49254 as the adjustment. That produces r49461 for the current 8a1f7c9 * removes the useless svn evaluation (similarly as in master). Signed-off-by: Hannu Nyman --- scripts/getver.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/getver.sh b/scripts/getver.sh index 4643ca63ff..0aebd29091 100755 --- a/scripts/getver.sh +++ b/scripts/getver.sh @@ -17,9 +17,9 @@ try_svn() { } try_git() { - [ -e .git ] || return 1 - REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')" - REV="${REV:+r$REV}" + git rev-parse --git-dir >/dev/null 2>&1 || return 1 + REV="$(git describe --tags | sed "s/v15.05.1-\([0-9]*\)-.*/\1/g")" + REV="${REV:+r$((REV+49254))}" [ -n "$REV" ] } @@ -30,5 +30,5 @@ try_hg() { [ -n "$REV" ] } -try_version || try_svn || try_git || try_hg || REV="unknown" +try_version || try_git || try_hg || REV="unknown" echo "$REV" -- 2.11.0