[Asterisk-code-review] build tools/make version: Get MAINLINE BRANCH from .gitreview. (asterisk[master])

George Joseph asteriskteam at digium.com
Tue Jul 24 05:40:50 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/9573 )

Change subject: build_tools/make_version: Get MAINLINE_BRANCH from .gitreview.
......................................................................

build_tools/make_version: Get MAINLINE_BRANCH from .gitreview.

Use .gitreview defaultbranch setting to determine the mainline branch.
This allows the script to be used against other directories which might
not be on the same defaultbranch.  This can be used by CI scripts to
report the testsuite version being used:
./build_tools/make_version ${TESTSUITE_DIR}

Change-Id: Ifdad4a9d8a26138c41bc6b630ecc3e34ea1c2758
---
M build_tools/make_version
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/build_tools/make_version b/build_tools/make_version
index ce3bf6e..ad9fb3f 100755
--- a/build_tools/make_version
+++ b/build_tools/make_version
@@ -3,7 +3,6 @@
 AWK=${AWK:-awk}
 GIT=${GIT:-git}
 GREP=${GREP:-grep}
-MAINLINE_BRANCH=master
 
 if [ -f ${1}/.version ]; then
     cat ${1}/.version
@@ -101,6 +100,7 @@
     MODIFIED=""
     SVN_REV=`${GIT} log --pretty=full -1 | ${GREP} -F "git-svn-id:" | sed -e "s/.*\@\([^\s]*\)\s.*/\1/g"`
     if [ -z "$SVN_REV" ]; then
+        MAINLINE_BRANCH=$(git config -f .gitreview --get gerrit.defaultbranch)
         VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`
         if [ $? -ne 0 ]; then
             if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then

-- 
To view, visit https://gerrit.asterisk.org/9573
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifdad4a9d8a26138c41bc6b630ecc3e34ea1c2758
Gerrit-Change-Number: 9573
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180724/6511582d/attachment.html>


More information about the asterisk-code-review mailing list