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 D03D5A00C5 for ; Tue, 1 Feb 2022 22:35:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A207F40698; Tue, 1 Feb 2022 22:35:55 +0100 (CET) Received: from mail-qt1-f225.google.com (mail-qt1-f225.google.com [209.85.160.225]) by mails.dpdk.org (Postfix) with ESMTP id 4F6C34067C for ; Tue, 1 Feb 2022 22:35:55 +0100 (CET) Received: by mail-qt1-f225.google.com with SMTP id b5so15642755qtq.11 for ; Tue, 01 Feb 2022 13:35:55 -0800 (PST) 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=VqDLmh3V2x5U9wM6r0HsD3z7CDnYNgQU5gxaCaw2FTk=; b=avTr8C/tEAl9fWfv4yMBjl4/a/Smmj8qqBNmweASwgBPzZoXIP/t7mj6sfGHBXwMBB GHkDuP1rqEIR1xXvO901ypTgDqNga5c9X7PnMJTlUYCRopXR8Nw8rx+8rMb63Y83vj5d r/f6nTS5pvWl8q2mog+reathO0zxA7sqCU0CA= 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=VqDLmh3V2x5U9wM6r0HsD3z7CDnYNgQU5gxaCaw2FTk=; b=BshFTQP5uKi6nXgVbm8m8hkb2sZa313j1E4gJS3/1dVkOFR8RJdED0KJEw6huzD4QH tsIPRJZnckcy4zXIKCwezBl0DiB2nVjTRJO7YUN1p6Bq+88+Dn/yfw01+JHpFmyH/cRz IkKRRQeiDB8VYuLhJmoT5zaNhbhPR0e0oRMVq6H93PfBG/ZMK2W4j8IN8sStgXMIZ/mF tqTPca/YrDhBJhqJEpm28/pWGPMedvOpr7RsZfQdJl8f/V3EBk9z/7EIwN2T5iC9BKCS wWW4Le6923irEt4fYvNTRDwsk4JxcsXUoo86V5WbAInQQ4zWBurAowFClWC9I25BeSo6 747Q== X-Gm-Message-State: AOAM533Etzo2TrGHRiSjPgeqm3djpBoN4Fl4yBybtXOTGNtuFjoDtG+O wOxZxiPHJzoyafMNBMRcOHv3MwGz22+siWC/pw1rqaYnn127sN6qdkfMRDPhBReqUMX+9UoT1L5 RnZOhh+L2D5kaxQOKIc+dfJRvnO4baFzpEyA8uTie6PKdZpThspnW/nxZJvfmfNCW7I00yW4m X-Google-Smtp-Source: ABdhPJyac+X4TZE/Dz9AnWHUfo0jSDVe236K77PuraJoExCD56WyMSiza3PP2sADpMlhBeB2oEDCbYNux/UH X-Received: by 2002:ac8:7fce:: with SMTP id b14mr13566916qtk.236.1643751354710; Tue, 01 Feb 2022 13:35:54 -0800 (PST) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id bm36sm2170181qkb.4.2022.02.01.13.35.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Feb 2022 13:35:54 -0800 (PST) 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 006A26052484; Tue, 1 Feb 2022 16:35:53 -0500 (EST) From: ohilyard@iol.unh.edu To: ci@dpdk.org, alialnu@nvidia.com Cc: Owen Hilyard Subject: [PATCH v3 4/4] guess_git_tree: fix crash caused by empty diff Date: Tue, 1 Feb 2022 16:35:45 -0500 Message-Id: <20220201213544.15754-4-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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/pw_maintainers_cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/pw_maintainers_cli.py b/tools/pw_maintainers_cli.py index 0705eee..975b62b 100755 --- a/tools/pw_maintainers_cli.py +++ b/tools/pw_maintainers_cli.py @@ -124,6 +124,11 @@ class Diff(object): - 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