[Asterisk-code-review] Remove GIT prefix, add hash only when dirty (repotools[master])

Scott Griepentrog asteriskteam at digium.com
Mon Aug 1 19:33:20 CDT 2016


Scott Griepentrog has uploaded a new change for review.

  https://gerrit.asterisk.org/3388

Change subject: Remove GIT prefix, add hash only when dirty
......................................................................

Remove GIT prefix, add hash only when dirty

Change-Id: Ia744e4292ab00b5030b24a5ef0ed67d8624e3cd5
---
M build_tools/make_version
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/88/3388/1

diff --git a/build_tools/make_version b/build_tools/make_version
index ab823e7..da5c6b9 100755
--- a/build_tools/make_version
+++ b/build_tools/make_version
@@ -23,8 +23,12 @@
         exit 1
     fi
     MODIFIED=""
-    VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
-    if [ $? -ne 0 ]; then
+    VERSION=`${GIT} describe --always --tags --dirty 2> /dev/null`
+    if [ $? -eq 0 ]; then
+        if [ "${VERSION:(-6)}" = "-dirty" ]; then
+            VERSION=`${GIT} describe --always --tags --long 2> /dev/null`
+        fi
+    else
         if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then
             MODIFIED="M"
         fi
@@ -32,7 +36,7 @@
         # options.
         VERSION=`${GIT} rev-parse --short --verify HEAD`${MODIFIED}
     fi
-    echo GIT-${VERSION}
+    echo ${VERSION}
 else
   echo "UNKNOWN_and_probably_unsupported"
 fi

-- 
To view, visit https://gerrit.asterisk.org/3388
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia744e4292ab00b5030b24a5ef0ed67d8624e3cd5
Gerrit-PatchSet: 1
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: Scott Griepentrog <sgriepentrog at digium.com>



More information about the asterisk-code-review mailing list