From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1203A0C55 for ; Wed, 13 Oct 2021 16:00:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 77D03411DD; Wed, 13 Oct 2021 16:00:14 +0200 (CEST) Received: from mail-pj1-f97.google.com (mail-pj1-f97.google.com [209.85.216.97]) by mails.dpdk.org (Postfix) with ESMTP id D48C640E64 for ; Wed, 13 Oct 2021 16:00:13 +0200 (CEST) Received: by mail-pj1-f97.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so2376586pjb.0 for ; Wed, 13 Oct 2021 07:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p9EHgVkujKfQArGAAIFCihz5K7xauyVLurTtcNTPifQ=; b=Y3agYOpjT0yRgt7zHpCoL5hQnsIxlJt0dHkqppTztIagUkExGRTHmr8ZJ6XMSgqsHS H0We5P74O+mGU+NUNjrIHLf0HqalSU4hSH4/SNqA7OFOjKUI7PzCxxiXaRRteTNQ+Zwq 67sofeGVIDl5S/iRriewyfP6sN2zLmRXp6CTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p9EHgVkujKfQArGAAIFCihz5K7xauyVLurTtcNTPifQ=; b=IBxu4Z8H+61XGLHRg1mfjnUZxPgHGe2oplnwMDatc6kwrOirfZDnrWNV8cZWIW4xt1 jOIVCradNTzBC7K0mwsadGvjfqyHcJeCYzLy79c6z2ahmtRLsBLwFf2K6IHIBTNSnl6g 914+E+AnBLbsnuspgTLqEUBzMCatrFY6v78cSTPiKlZvMLFPjMWtu6d1cYdRMLCnxBi9 ry2z4P5oF3N9S1ZtDkBOzPJgY4rpq42jBfqAYwm0pUPC0tQCjx5417Dw9oNwXW495Gfj wQVNk7HjoBOLUKx2jkErG4pqNoM5VFxN2nCTg5O1hm9w8AWnhE5eAfdcBsf9PFVDfsjd wEHw== X-Gm-Message-State: AOAM532Etk5n90pEkdTsTOmxrtZobQ3Fy7FoRfkjSKGRlVm7TySgmLDg seFhJYBI6m+WNK86N8rZ/OkXcIqcY1fAelj6inHdu9ftgNRFcARe4Jmn+CRSIVhIT5lgbH6iffS EKvbRLV5nHf+UciZy67Qyfor1C2jcSVMc7TtQ264bDKhg3W6oO+A4nNP594hTLcC7TtMEjMHo X-Google-Smtp-Source: ABdhPJzOxiQ+rTpeo0DhrxK1wd4YmxCsKsopi2ygg++9xZBQgaOcA0aCmUJSfNFnDENMEUo3OE4f2egJwyvr X-Received: by 2002:a17:902:c401:b0:13e:f5f2:f852 with SMTP id k1-20020a170902c40100b0013ef5f2f852mr35787359plk.29.1634133612950; Wed, 13 Oct 2021 07:00:12 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id nv6sm1931052pjb.13.2021.10.13.07.00.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Oct 2021 07:00:12 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::105d]) by postal.iol.unh.edu (Postfix) with ESMTP id 36A996052447; Wed, 13 Oct 2021 10:00:12 -0400 (EDT) From: ohilyard@iol.unh.edu To: ci@dpdk.org Cc: aconole@redhat.com, alialnu@nvidia.com, Owen Hilyard Date: Wed, 13 Oct 2021 10:00:10 -0400 Message-Id: <20211013140010.25400-4-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013140010.25400-1-ohilyard@iol.unh.edu> References: <20211013140010.25400-1-ohilyard@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-ci] [PATCH v2 4/4] guess_git_tree: fix crash caused by empty diff X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org Sender: "ci" From: Owen Hilyard A sanity check has been added to find_filenames. Occasionally, due to how the community lab internally handles getting patches from patchworks, a patch will result in no diff. This patch adds handling for this case. Signed-off-by: Owen Hilyard --- tools/guess_git_tree.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/guess_git_tree.py b/tools/guess_git_tree.py index e186f5e..63892e1 100755 --- a/tools/guess_git_tree.py +++ b/tools/guess_git_tree.py @@ -92,6 +92,11 @@ def find_filenames(diff): - Moved _filename_re into the method. - Reduced newlines. """ + # sanity check diff + # for patches without any diff, it will try to run diff.replace + # while diff is None. just return an empty list + if diff is None: + return [] _filename_re = re.compile(r'^(---|\+\+\+) (\S+)') # normalise spaces diff = diff.replace('\r', '') -- 2.30.2