From patchwork Sun May 5 20:20:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1095552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44xy184dlQz9s9N for ; Mon, 6 May 2019 06:20:44 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i1zRAysd"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 44xy166JvczDqJM for ; Mon, 6 May 2019 06:20:42 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::52b; helo=mail-ed1-x52b.google.com; envelope-from=petr.vorel@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i1zRAysd"; dkim-atps=neutral Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 44xy0l2L54zDqFB for ; Mon, 6 May 2019 06:20:19 +1000 (AEST) Received: by mail-ed1-x52b.google.com with SMTP id g57so12912474edc.12 for ; Sun, 05 May 2019 13:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FOpAWX+UKADAMmQEFnL0qaCmRPXJGeQ8Bs5P82hS++0=; b=i1zRAysdp4XdwAvsBUJOExPHLyVjQXAxtnPFpZXCbUnCzRoPqE5FysPuQjNso1OtUt rN3cKkOTEjABvP5mKkqFO8wKFTvP+ugwUbCQnEyTy4DzeH9WFRDDZ9YLKPHuU350EAAf ywD/Gu/fjZtRdpnkyMqKWxeNC79zPdksQpnU9Z8WYqrnZkvroTYpBpDk3ou4VOOsc/Fz GGAXEQo3MdailS3qe0ntAHhac8oe8H8+r+66UODmHlA3XwpYoRGgkk+/+oDzvYriagu1 c99TINPv7dzyX0i1Ov8/KaHZcuRUKyslG0Xo3EQKpJ8LKt78WXm70ioIGPSS+CLkTRLE uXoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FOpAWX+UKADAMmQEFnL0qaCmRPXJGeQ8Bs5P82hS++0=; b=sv+CFYmZRWN0n7lzNWYyqfdzVJJOgXMWs79kqJo61a/rghCDl4VdXggKQsn3FP3SdH YptWGBzC9BvWcHIaEmdKDD5AUH8EPLPr2ZsezTGuqZZyiNKZjyUcFBUMjYiWTMJmTSks TsfZchEohixF340dMp3rW6OxMYX5VzrsHySjg2S4aVSZ/kYRPYuFk4RE1Pl1Hj8+rQM0 SEp4HN+s+ukVKkiUkwm6bzzcef7jHdzciKOlqHw2TmMQIxTEw6XPlOBVLu34iqHYDkZn h4nE2FdgFDxmOlqBwKfbi2YG9WClXvPymD0oY/8LUwth3lJR4imaTirm47nYVw3WDe/6 qQKw== X-Gm-Message-State: APjAAAWxGZMGy9MYXgesYNMiA9k6BbMycD2+zqvG0+di3drvoCyseCUA l0nsA75Qe/C7nM3pl+bEn72bN3NR/Cc= X-Google-Smtp-Source: APXvYqyWDnfVoozXTZ2SmvQ3uyiRNHZoWAZeJaFXz7UCHl5dsszCw1HtAUw2PiSXRrPjx3I3zO216Q== X-Received: by 2002:a50:84a1:: with SMTP id 30mr20921531edq.105.1557087614801; Sun, 05 May 2019 13:20:14 -0700 (PDT) Received: from dell5510.suse.cz ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id s15sm2389853edm.6.2019.05.05.13.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 May 2019 13:20:13 -0700 (PDT) From: Petr Vorel To: patchwork@lists.ozlabs.org Subject: [PATCH 1/1] parser: Add missing extended header lines Date: Sun, 5 May 2019 22:20:05 +0200 Message-Id: <20190505202005.18181-1-petr.vorel@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Patchwork didn't recognise some patches due missing some extended header lines (e.g. "old mode" and "new mode" for renaming file mode, see [1]). Thus adding all modes from git doc [2]. Fixes: #267 [1] https://lists.ozlabs.org/pipermail/patchwork/2019-April/005741.html [2] https://git-scm.com/docs/git-diff#_generating_patches_with_p Suggested-by: Veronika Kabatova Signed-off-by: Petr Vorel --- patchwork/parser.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/patchwork/parser.py b/patchwork/parser.py index 712780a..633fc71 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -752,7 +752,7 @@ def parse_patch(content): # 3 -> 4 (@@ line) # 4 -> 5 (patch content) # 5 -> 1 (run out of lines from @@-specifed count) - # 1 -> 6 (rename from / rename to / new file / index) + # 1 -> 6 (extended header lines) # 6 -> 2 (---) # 6 -> 1 (other text) # @@ -782,7 +782,15 @@ def parse_patch(content): if line.startswith('--- '): state = 2 - if line.startswith(('rename from ', 'rename to ', + # extended header lines + # @see https://git-scm.com/docs/git-diff#_generating_patches_with_p + if line.startswith(('old mode ', 'new mode ', + 'deleted file mode ', + 'new file mode ', + 'copy from ', 'copy to ', + 'rename from ', 'rename to ', + 'similarity index ', + 'dissimilarity index ', 'new file mode ', 'index ')): state = 6 elif state == 2: