<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19993">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">make_version: Strip svn stuff and suppress ref HEAD errors<br><br>* All of the code that used subversion has been removed.<br><br>* When Asterisk is checked out from a tag or commit instead<br> of one of the regular branches, git would emit messages like<br> "fatal: ref HEAD is not a symbolic ref" which weren't fatal<br> at all. Those are now suppressed.<br><br>Change-Id: I2a11bc9ebbaf6dfa50f53516ede50a6bac65ca3c<br>---<br>M build_tools/make_version<br>1 file changed, 74 insertions(+), 212 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/build_tools/make_version b/build_tools/make_version</span><br><span>index 58395ca..c2422d8 100755</span><br><span>--- a/build_tools/make_version</span><br><span>+++ b/build_tools/make_version</span><br><span>@@ -1,220 +1,66 @@</span><br><span> #!/bin/sh</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-AWK=${AWK:-awk}</span><br><span> GIT=${GIT:-git}</span><br><span style="color: hsl(0, 100%, 40%);">-GREP=${GREP:-grep}</span><br><span> SED=${SED:-sed}</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> if [ -f ${1}/.version ]; then</span><br><span> cat ${1}/.version</span><br><span style="color: hsl(0, 100%, 40%);">-elif [ -d ${1}/.svn ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- PARTS=`LANG=C svn info ${1} | ${GREP} URL | ${AWK} '{print $2;}' | ${SED} -e 's:^.*/svn/asterisk/::' | ${SED} -e 's:/: :g'`</span><br><span style="color: hsl(0, 100%, 40%);">- BRANCH=0</span><br><span style="color: hsl(0, 100%, 40%);">- TEAM=0</span><br><span style="color: hsl(0, 100%, 40%);">- TAG=0</span><br><span style="color: hsl(0, 100%, 40%);">- FEATURE=0</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- REV=`svnversion -c ${1} | cut -d: -f2`</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- INTEGRATED=`LANG=C svn pg automerge-propname ${1}`</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -z "${INTEGRATED}" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- INTEGRATED=svnmerge-integrated</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- BASE=`LANG=C svn pg ${INTEGRATED} ${1} | cut -d: -f1`</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PARTS}" = "trunk" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo SVN-trunk-r${REV}</span><br><span style="color: hsl(0, 100%, 40%);">- exit 0</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- for PART in $PARTS ; do</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${TAG} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "autotag_for_be" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "autotag_for_sx00i" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- break</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${BRANCH} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${RESULT}-${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${FEATURE} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${RESULT}-${FEATURE_NAME}"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- break</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${TEAM} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -z "${RESULT}" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${RESULT}-${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "certified" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- FEATURE=1</span><br><span style="color: hsl(0, 100%, 40%);">- FEATURE_NAME="cert"</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "branches" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- BRANCH=1</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="branch"</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "tags" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- TAG=1</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "team" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- TEAM=1</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- done</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${TAG} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo ${RESULT}</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- echo SVN-${RESULT}-r${REV}${BASE:+-${BASE}}</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-elif [ -d ${1}/.git ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -z ${GIT} ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- GIT="git"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if ! command -v ${GIT} >/dev/null 2>&1; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo "UNKNOWN__and_probably_unsupported"</span><br><span style="color: hsl(0, 100%, 40%);">- exit 1</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- GITCHECK=$(${GIT} describe --always 2>/dev/null || echo gitfail 2>/dev/null)</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "x${GITCHECK}" = "xgitfail" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo "UNKNOWN__git_check_fail"</span><br><span style="color: hsl(0, 100%, 40%);">- exit 1</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- cd ${1}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- # If the first log commit messages indicates that this is checked into</span><br><span style="color: hsl(0, 100%, 40%);">- # subversion, we'll just use the SVN- form of the revision.</span><br><span style="color: hsl(0, 100%, 40%);">- MODIFIED=""</span><br><span style="color: hsl(0, 100%, 40%);">- SVN_REV=`${GIT} log --pretty=full -1 | ${SED} -n '/git-svn-id:/ s/.*\@\([^ ]*\) .*/\1/p'`</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -z "$SVN_REV" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- # If MAINLINE_BRANCH is already set in the environment, use it.</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -z "${MAINLINE_BRANCH}" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- # Try to retrieve MAINLINE_BRANCH from a local .develvars file first.</span><br><span style="color: hsl(0, 100%, 40%);">- # .develvars is keyed by the branch name so we need to get that first.</span><br><span style="color: hsl(0, 100%, 40%);">- BRANCH=$(${GIT} symbolic-ref --short HEAD)</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -f .develvars ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- MAINLINE_BRANCH=$(${GIT} config -f .develvars --get branch.${BRANCH}.mainline-branch)</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- # If we didn't find it, see if this is a well-known development branch.</span><br><span style="color: hsl(0, 100%, 40%);">- # development/<mainline_branch>/<branchname> or</span><br><span style="color: hsl(0, 100%, 40%);">- # devel/<mainline_branch>/<branchname></span><br><span style="color: hsl(0, 100%, 40%);">- if [ "x${MAINLINE_BRANCH}" = "x" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- MAINLINE_BRANCH=$(echo "${BRANCH}" | ${SED} -n -r -e "s@devel(opment)?/([0-9]+)/.+@\2@p")</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- # If we didn't find it, get it from .gitreview defaultbranch.</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "x${MAINLINE_BRANCH}" = "x" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- MAINLINE_BRANCH=$(${GIT} config -f .gitreview --get gerrit.defaultbranch)</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`</span><br><span style="color: hsl(0, 100%, 40%);">- if [ $? -ne 0 ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- MODIFIED="M"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- # Some older versions of git do not support all the above</span><br><span style="color: hsl(0, 100%, 40%);">- # options.</span><br><span style="color: hsl(0, 100%, 40%);">- VERSION=`${GIT} rev-parse --short --verify HEAD`${MODIFIED}</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- echo GIT-${MAINLINE_BRANCH}-${VERSION}</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- PARTS=`LANG=C ${GIT} log --pretty=full | ${GREP} -F "git-svn-id:" | head -1 | ${AWK} '{print $2;}' | ${SED} -e s:^.*/svn/$2/:: | ${SED} -e 's:/: :g' | ${SED} -e 's/@.*$//g'`</span><br><span style="color: hsl(0, 100%, 40%);">- BRANCH=0</span><br><span style="color: hsl(0, 100%, 40%);">- TEAM=0</span><br><span style="color: hsl(0, 100%, 40%);">- TAG=0</span><br><span style="color: hsl(0, 100%, 40%);">- FEATURE=0</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- MODIFIED="M"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- for PART in $PARTS ; do</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${TAG} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "autotag_for_be" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "autotag_for_sx00i" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- break</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${BRANCH} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${RESULT}-${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${FEATURE} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${RESULT}-${FEATURE_NAME}"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- break</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${TEAM} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- if [ -z "${RESULT}" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="${RESULT}-${PART}"</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "certified" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- FEATURE=1</span><br><span style="color: hsl(0, 100%, 40%);">- FEATURE_NAME="cert"</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "branches" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- BRANCH=1</span><br><span style="color: hsl(0, 100%, 40%);">- RESULT="branch"</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "tags" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- TAG=1</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "team" ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- TEAM=1</span><br><span style="color: hsl(0, 100%, 40%);">- continue</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ "${PART}" = "trunk" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo SVN-trunk-r${SVN_REV}${MODIFIED}</span><br><span style="color: hsl(0, 100%, 40%);">- exit 0</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- done</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if [ ${TAG} != 0 ] ; then</span><br><span style="color: hsl(0, 100%, 40%);">- echo ${RESULT}</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(0, 100%, 40%);">- echo SVN-${RESULT##-}-r${SVN_REV}${MODIFIED}</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">- fi</span><br><span style="color: hsl(0, 100%, 40%);">-else</span><br><span style="color: hsl(0, 100%, 40%);">- echo "UNKNOWN__and_probably_unsupported"</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 0</span><br><span> fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if [ ! -d ${1}/.git ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "UNKNOWN__and_probably_unsupported"</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 0</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if [ -z ${GIT} ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+ GIT="git"</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if ! command -v ${GIT} >/dev/null 2>&1; then</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "UNKNOWN__and_probably_unsupported"</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+GITCHECK=$(${GIT} describe --always 2>/dev/null || echo gitfail 2>/dev/null)</span><br><span style="color: hsl(120, 100%, 40%);">+if [ "x${GITCHECK}" = "xgitfail" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+ echo "UNKNOWN__git_check_fail"</span><br><span style="color: hsl(120, 100%, 40%);">+ exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+cd ${1} || exit 1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+MODIFIED=""</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# If MAINLINE_BRANCH is already set in the environment, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+if [ -z "${MAINLINE_BRANCH}" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ # Try to retrieve MAINLINE_BRANCH from a local .develvars file first.</span><br><span style="color: hsl(120, 100%, 40%);">+ # .develvars is keyed by the branch name so we need to get that first.</span><br><span style="color: hsl(120, 100%, 40%);">+ BRANCH=$(${GIT} symbolic-ref --short HEAD 2>/dev/null)</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ -f .develvars ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ MAINLINE_BRANCH=$(${GIT} config -f .develvars --get branch.${BRANCH}.mainline-branch)</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # If we didn't find it, see if this is a well-known development branch.</span><br><span style="color: hsl(120, 100%, 40%);">+ # development/<mainline_branch>/<branchname> or</span><br><span style="color: hsl(120, 100%, 40%);">+ # devel/<mainline_branch>/<branchname></span><br><span style="color: hsl(120, 100%, 40%);">+ if [ "x${MAINLINE_BRANCH}" = "x" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ MAINLINE_BRANCH=$(echo "${BRANCH}" | ${SED} -n -r -e "s@devel(opment)?/([0-9]+)/.+@\2@p")</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # If we didn't find it, get it from .gitreview defaultbranch.</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ "x${MAINLINE_BRANCH}" = "x" ] ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ MAINLINE_BRANCH=$(${GIT} config -f .gitreview --get gerrit.defaultbranch)</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+VERSION=`${GIT} describe --long --always --tags --dirty=M 2> /dev/null`</span><br><span style="color: hsl(120, 100%, 40%);">+if [ $? -ne 0 ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if [ "`${GIT} ls-files -m | wc -l`" != "0" ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+ MODIFIED="M"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ # Some older versions of git do not support all the above</span><br><span style="color: hsl(120, 100%, 40%);">+ # options.</span><br><span style="color: hsl(120, 100%, 40%);">+ VERSION=`${GIT} rev-parse --short --verify HEAD`${MODIFIED}</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+echo GIT-${MAINLINE_BRANCH}-${VERSION}</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19993">change 19993</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19993"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I2a11bc9ebbaf6dfa50f53516ede50a6bac65ca3c </div>
<div style="display:none"> Gerrit-Change-Number: 19993 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>