From nobody Mon Feb 9 12:43:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599237847; cv=none; d=zohomail.com; s=zohoarc; b=WvdHZsUYOWcMYy3yjcQFGg4l7/jpD8qAFtaLpqMriQ9uRXJ7kkPjJHoAo3uJYgk8SAjo0a0Hgp+F1FHAp++Tbg+FEZQJ/34vO0ku8elaPKsXrsdll/HJeGj3LwuqCZeGS94w4fIwkLX/NRZLQXtmvfBfc9rF+XYUHCE8txp9kuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599237847; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3SG4rZsTyVR/4ilfHyM/tvLD0I89uc+m7TY0jqe/t+0=; b=kOn8SqZDetjMuVHwO7q0RTcrdE3ZlraEWP24A9oQgOm46Vlzr5Ou0tBpRiZL/F89Xm6QqJEbaMCzps/zd6ZWg73wuK6d/kVReMmzaQdJ8vRB8bPra1oxrVcXYIsA5lSH5orl2+hZrZUqsLEdQ7S3+0setI8lFgJZJ5G2F+10FaE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599237847628966.371225820867; Fri, 4 Sep 2020 09:44:07 -0700 (PDT) Received: from localhost ([::1]:48036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEEoo-00081p-BY for importer@patchew.org; Fri, 04 Sep 2020 12:44:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEEnz-0006iI-DI for qemu-devel@nongnu.org; Fri, 04 Sep 2020 12:43:15 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:22287 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kEEnv-0000Ao-VS for qemu-devel@nongnu.org; Fri, 04 Sep 2020 12:43:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-opbDeT5uOLOd14OCXWwJ_g-1; Fri, 04 Sep 2020 12:43:06 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3B521074660; Fri, 4 Sep 2020 16:43:04 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-120-166.rdu2.redhat.com [10.10.120.166]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C952719C59; Fri, 4 Sep 2020 16:43:03 +0000 (UTC) X-MC-Unique: opbDeT5uOLOd14OCXWwJ_g-1 From: Cleber Rosa To: qemu-devel@nongnu.org, Peter Maydell Subject: [PATCH 1/7] scripts/ci/gitlab-pipeline-status: make branch name configurable Date: Fri, 4 Sep 2020 12:42:52 -0400 Message-Id: <20200904164258.240278-2-crosa@redhat.com> In-Reply-To: <20200904164258.240278-1-crosa@redhat.com> References: <20200904164258.240278-1-crosa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=crosa@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/04 03:58:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Beraldo Leal , Wainer dos Santos Moschetta , Willian Rampazzo , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" With the utility function `get_local_staging_branch_commit()`, the name of the branch is hard coded (including in the function name). For extensibility reasons, let's make that configurable. Signed-off-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/ci/gitlab-pipeline-status | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ci/gitlab-pipeline-status b/scripts/ci/gitlab-pipeline= -status index 348a49b6a4..194dd4d0bb 100755 --- a/scripts/ci/gitlab-pipeline-status +++ b/scripts/ci/gitlab-pipeline-status @@ -23,20 +23,20 @@ import time import sys =20 =20 -def get_local_staging_branch_commit(): +def get_local_branch_commit(branch=3D'staging'): """ Returns the commit sha1 for the *local* branch named "staging" """ - result =3D subprocess.run(['git', 'rev-parse', 'staging'], + result =3D subprocess.run(['git', 'rev-parse', branch], stdin=3Dsubprocess.DEVNULL, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.DEVNULL, cwd=3Dos.path.dirname(__file__), universal_newlines=3DTrue).stdout.strip() - if result =3D=3D 'staging': - raise ValueError("There's no local branch named 'staging'") + if result =3D=3D branch: + raise ValueError("There's no local branch named '%s'" % branch) if len(result) !=3D 40: - raise ValueError("Branch staging HEAD doesn't look like a sha1") + raise ValueError("Branch '%s' HEAD doesn't look like a sha1" % bra= nch) return result =20 =20 @@ -110,7 +110,7 @@ def main(): 'for https://gitlab.com/qemu-project/qemu, t= hat ' 'is, "%(default)s"')) try: - default_commit =3D get_local_staging_branch_commit() + default_commit =3D get_local_branch_commit() commit_required =3D False except ValueError: default_commit =3D '' --=20 2.25.4