<p>Neels Hofmeyr <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/11756">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gits: use @{u} to get upstream branch, not origin/%s<br><br>git has an internal concept of a branch's upstream branch, and the remote need<br>not be 'origin', and also, the upstream branch name may differ completely. So,<br>use git's {u} keyword to obtain the upstream branch name.<br><br>This removes all 'origin' strings from gits. Also, git_branch_exists() is no<br>longer needed, drop it.<br><br>Also remove a couple of default arguments which aren't ever used because we<br>always pass arguments anyway.<br><br>In the case of git_ahead_behind(), we would have use for a default<br>branch_upstream=None to imply calling git_branch_upstream(), but then during<br>rebase, if no upstream exists, we would invoke it twice to get None a second<br>time. So just call the function explicitly. I thought about returning an empty<br>string instead of None, but it's too convoluted.<br><br>In git_output(), pipe STDERR to STDOUT, because every time we parse a remote<br>ref (git ref-parse --abbrev-ref '%s{u}') and there is no remote branch, git<br>prints 'Fatal: there is no remote bla bla' on stdout, and that error is<br>expected / ok to happen, so it just clutters the 'gits' output. The easiest way<br>to achieve silence then is to pipe to STDOUT, IIUC otherwise we'd have to use<br>Popen() and communicate()... In the case of error, subprocess raises an<br>exception and we see that an error happens. In the ref-parse case we can simply<br>catch the exception and be quiet.<br><br>Change-Id: Ife146903ae1323a4e568587ccfd4018725e9d719<br>---<br>M src/gits<br>1 file changed, 30 insertions(+), 22 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/56/11756/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/11756">change 11756</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/11756"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-dev </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: Ife146903ae1323a4e568587ccfd4018725e9d719 </div>
<div style="display:none"> Gerrit-Change-Number: 11756 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>