Neels Hofmeyr has posted comments on this change. (
https://gerrit.osmocom.org/11756 )
Change subject: gits: use @{u} to get upstream branch, not origin/%s
......................................................................
Patch Set 3:
(1 comment)
https://gerrit.osmocom.org/#/c/11756/1/src/gits
File src/gits:
https://gerrit.osmocom.org/#/c/11756/1/src/gits@61
PS1, Line 61: return subprocess.check_output(['git', '-C', git_dir, ] +
list(args), stderr=subprocess.STDOUT).decode('utf-8')
> why is this needed?
because every time we parse a remote ref (git ref-parse --abbrev-ref '%s{u}')
and there is no remote branch, git prints 'Fatal: there is no remote bla bla'
on stdout, and that error is expected / ok to happen, so it just clutters the
'gits' output.
In the other cases, if there is an error, subprocess raises an exception and we
see that an error happens. In the ref-parse case we can simply catch the
exception and be quiet.
--
To view, visit https://gerrit.osmocom.org/11756
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ife146903ae1323a4e568587ccfd4018725e9d719
Gerrit-Change-Number: 11756
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Comment-Date: Mon, 19 Nov 2018 15:54:43 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No