From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D49F3C35257 for ; Fri, 2 Oct 2020 23:29:53 +0000 (UTC) Received: by mail.kernel.org (Postfix) id BAF7D2074B; Fri, 2 Oct 2020 23:29:53 +0000 (UTC) Received: from [192.168.1.64] (unknown [89.36.78.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7BED12072E for ; Fri, 2 Oct 2020 23:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601681393; bh=EvCVtFwfDvyLhT3QaFh076v4aIjklO/3C0p9j/BSCho=; h=From:List-Id:To:Subject:Date:In-Reply-To:References:From; b=uP1ul7FP0hymvE8lwJ3KQXPgmH97AdU7E0TkluAwfgH+sXEse73EsSIVC6bMS+Xg/ 4GsEzDah56RRHYrkTYyet95yz0+tWwJvGpZhoy2ZLoHG2p3bg2Y0sn2MjuP8GkuU8n a+y5NUns4oEj8zypv02dVF+eedaNa8QWa8dq8ktM= From: Konstantin Ryabitsev List-Id: To: signatures@kernel.org Subject: [PATCH 09/10] Don't crash when no valid patches are found Date: Fri, 2 Oct 2020 19:29:14 -0400 Message-Id: <20201002232915.1728301-10-konstantin@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201002232915.1728301-1-konstantin@linuxfoundation.org> References: <20201002232915.1728301-1-konstantin@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patch-Hashes: v=1; h=sha256; g=9a104d91c459a3142bcf063552d9c71a2a2ac5bc; i=+GILnxrDN1HGj0UPblZc9cbEOUFPuhD77RD7y7YFRyg=; m=780qdOnqS7qxdVbdHhmjUfQH27Y9ivmOY00WmdeWYrk=; p=ojFBER+5EHKO/u+J+FddWZo5B1Ry1qeT5shF0Jkr6EY= X-Patch-Sig: m=pgp; i=konstantin@linuxfoundation.org; s=0xB6C41CE35664996C; b=iHUEABYIAB0WIQR2vl2yUnHhSB5njDW2xBzjVmSZbAUCX3e37QAKCRC2xBzjVmSZbNvbAQDKPe4 Co47AFhJYRtA/NbWzMjMEkYHGIOebO7t04JFaCQD/Z9CQFWM3wV6Rn6/iZO+vO2J5VZRX81c4ywfQ cPXwHQs= Error out when we don't find any patches in an mbox when trying to diff series. Reported-by: Krzysztof Kozlowski Signed-off-by: Konstantin Ryabitsev --- b4/diff.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/b4/diff.py b/b4/diff.py index 81e015a..10f3159 100644 --- a/b4/diff.py +++ b/b4/diff.py @@ -101,6 +101,9 @@ def diff_mboxes(cmdargs): lmbx = b4.LoreMailbox() for key, msg in mbx.items(): lmbx.add_message(msg) + if len(lmbx.series) < 1: + logger.critical('No valid patches found in %s', mboxfile) + sys.exit(1) if len(lmbx.series) > 1: logger.critical('More than one series version in %s, will use latest', mboxfile) -- 2.26.2