<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18017">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">build: Refactor the earlier "basebranch" thing<br><br>The earlier attempt at adding a "basebranch" variable to<br>.gitreview didn't work out too well in practice because changes<br>were made to .gitreview, which it a checked-in file.  So, if<br>you wanted to rebase your work branch on the base branch, rebase<br>would attempt to overwrite your .gitreview with the one from<br>the base branch and complain about a conflict.<br><br>This is a slighltly different approach.  Instead of storing<br>the basebranch in .gitreview, it can now be stored in a<br>non-checked-in .develvars file and keyed by the current branch.<br><br>So, if you were working on development/16/something and wanted<br>to push to that branch in gerrit but wanted to pull the external<br>modules for 16, you'd create the following .develvars file:<br><br>[branch "development/16/something"]<br>    mainline-branch = 16<br><br>Of course you could have other things in there as well...<br><br>[branch "development/18/something"]<br>    mainline-branch = 18<br><br>[branch "development/19/something_new"]<br>    mainline-branch = 19<br><br>The key is that the .develvars file is NEVER checked in (it's been<br>added to .gitignore).<br><br>This commit also removes the "basebranch" entry that was added by<br>the earlier commit from the .gitreview file.<br><br>Change-Id: I1cdeeaa0944bba3f2e01d7a2039559d0c266f8c9<br>---<br>M .gitignore<br>M .gitreview<br>M build_tools/make_version<br>3 files changed, 8 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/17/18017/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/.gitignore b/.gitignore</span><br><span>index 0f31820..1ba75fa 100644</span><br><span>--- a/.gitignore</span><br><span>+++ b/.gitignore</span><br><span>@@ -37,4 +37,4 @@</span><br><span> out/</span><br><span> *.orig</span><br><span> tests/CI/output</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+.develvars</span><br><span>diff --git a/.gitreview b/.gitreview</span><br><span>index a233c59..a57dca7 100644</span><br><span>--- a/.gitreview</span><br><span>+++ b/.gitreview</span><br><span>@@ -1,6 +1,5 @@</span><br><span> [gerrit]</span><br><span> defaultbranch=16</span><br><span style="color: hsl(0, 100%, 40%);">-basebranch=16</span><br><span> #</span><br><span> # Intentional padding to ensure it is possible to point a commit</span><br><span> # to an alternative gerrit server/repository without breaking</span><br><span>diff --git a/build_tools/make_version b/build_tools/make_version</span><br><span>index aefe6b1..f19cb94 100755</span><br><span>--- a/build_tools/make_version</span><br><span>+++ b/build_tools/make_version</span><br><span>@@ -100,7 +100,13 @@</span><br><span>     MODIFIED=""</span><br><span>     SVN_REV=`${GIT} log --pretty=full -1 | sed -n '/git-svn-id:/ s/.*\@\([^ ]*\) .*/\1/p'`</span><br><span>     if [ -z "$SVN_REV" ]; then</span><br><span style="color: hsl(0, 100%, 40%);">-        MAINLINE_BRANCH=$(${GIT} config -f .gitreview --get gerrit.basebranch)</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)</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%);">+        # If we didn't find it, get it from .gitreview defaultbranch.</span><br><span>         if [ "x${MAINLINE_BRANCH}" = "x" ] ; then</span><br><span>             MAINLINE_BRANCH=$(${GIT} config -f .gitreview --get gerrit.defaultbranch)</span><br><span>         fi</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18017">change 18017</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/+/18017"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I1cdeeaa0944bba3f2e01d7a2039559d0c266f8c9 </div>
<div style="display:none"> Gerrit-Change-Number: 18017 </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-MessageType: newchange </div>