Change in osmo-dev[master]: gits: use @{u} to get upstream branch, not origin/%s

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Nov 19 15:54:43 UTC 2018


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 <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Comment-Date: Mon, 19 Nov 2018 15:54:43 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181119/d13d9ae3/attachment.htm>


More information about the gerrit-log mailing list