Patch Detail
Show a patch.
GET /api/1.1/patches/19380/?format=api
{ "id": 19380, "url": "https://patchwork.libcamera.org/api/1.1/patches/19380/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19380/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240109141623.4131307-1-kieran.bingham@ideasonboard.com>", "date": "2024-01-09T14:16:23", "name": "[libcamera-devel] hooks: pre-push: Disable interpretation of escape sequences", "commit_ref": "ffcd1b2804bf32be0aa96c108f9b3b2bfebdfa99", "pull_url": null, "state": "accepted", "archived": false, "hash": "1582315e49f5672471d0b94a917c484b89be64af", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19380/mbox/", "series": [ { "id": 4136, "url": "https://patchwork.libcamera.org/api/1.1/series/4136/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4136", "date": "2024-01-09T14:16:23", "name": "[libcamera-devel] hooks: pre-push: Disable interpretation of escape sequences", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4136/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19380/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19380/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 98436BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 9 Jan 2024 14:16:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D0E562B30;\n\tTue, 9 Jan 2024 15:16:30 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECD1361D7B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 9 Jan 2024 15:16:28 +0100 (CET)", "from Monstersaurus.local\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BE614552;\n\tTue, 9 Jan 2024 15:15:24 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1704809790;\n\tbh=Sndspa0p6GRdECepK+sYHSfUcsg2baiQTsy8NI3xFgc=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=GT64UxtrB2zfvurLgNTEDIzazHpVE/BVFXM2ehLQyNBRCkpSX9Rcp80gU7TYHRdMp\n\tZrNrcSdzKSfYRPN+7JKAC/eFZkNuPYouDfmuxDMNS+hVhaV6tcoUz02DZarUV6wK/g\n\tegE/ot31LOAYA7g1S/yTXpP3mhYOinU1tHcKNWmlI2x6vEIgGBEsZgJKWFrFKUByHZ\n\t37SbPa0lGeOw2lxBnf7CoCQGmD4hhi4uniJqH3a3EwE0dIMqWq1/+wuO1Da6zNTsxM\n\t2DyZVdSk04yrVm9OGOJL3svqRFHHrYDz3O1kX/H/yR6AjFJNYMV/+2vSf2XCns5zWz\n\tE+8kopF0Q4a6Q==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1704809724;\n\tbh=Sndspa0p6GRdECepK+sYHSfUcsg2baiQTsy8NI3xFgc=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=NOQvE/AgYO2DlEONarayw53A8DzoJOUTrsasthrsELZ+04n+BsYNSNj7sCxC5r1gR\n\tJVuS0/wqAmBTFnO9IY0ujlmdXArB4BkZ2riMEYz+pLvy8yf3NrwrxCu5zE22wnuAlY\n\tFoOlQUsoeN28L5Tub1aBhjfLfRD1hSIZVbYpmF0o=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"NOQvE/Ag\"; dkim-atps=neutral", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Tue, 9 Jan 2024 14:16:23 +0000", "Message-Id": "<20240109141623.4131307-1-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] hooks: pre-push: Disable interpretation\n\tof escape sequences", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "From": "Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The pre-push hook validates the commit messages utilising 'echo' to send\nthe captured data from the git commit through grep.\n\nCommit messages may occasionally contain strings that could appear to be\nescape sequences such as doxygen style references to \\struct.\n\nThe '\\' 'c' escape sequence can be interpreted to supress all further\noutput [0] which then breaks the processing and string matching.\n\nUnfortunatley for us, doxygen's class reference constructed in the same\nform as \\struct can be interpreted as the escape sequence to supress\nfurther output.\n\n[0] https://www.gnu.org/software/bash/manual/bash.html#Bash-Builtins\n\nUpdate the pre-push hook to explicitly disable escape sequence\ninterpretation using the '-E' flag. This is not available on the\nposix-compliant shell 'dash', so also switch to bash explicitly to\nprevent potential failures.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n utils/hooks/pre-push | 12 ++++++------\n 1 file changed, 6 insertions(+), 6 deletions(-)", "diff": "diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push\nindex 90ffdf6f1755..9918b2861705 100755\n--- a/utils/hooks/pre-push\n+++ b/utils/hooks/pre-push\n@@ -1,4 +1,4 @@\n-#!/bin/sh\n+#!/bin/bash\n \n # SPDX-License-Identifier: GPL-2.0-or-later\n \n@@ -61,7 +61,7 @@ do\n \t\tmsg=$(git cat-file commit \"$commit\")\n \n \t\t# 1. The commit message shall not contain a local changelog.\n-\t\tif echo \"$msg\" | grep -q '^--- *$'\n+\t\tif echo -E \"$msg\" | grep -q '^--- *$'\n \t\tthen\n \t\t\techo >&2 \"Found local changelog in commit $commit\"\n \t\t\terrors=$((errors+1))\n@@ -71,7 +71,7 @@ do\n \t\t# corresponding the committer and the author.\n \t\tcommitter=$(echo \"$msg\" | grep '^committer ' | head -1 | \\\n \t\t\t\tcut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev)\n-\t\tif ! echo \"$msg\" | grep -F -q \"Signed-off-by: ${committer}\"\n+\t\tif ! echo -E \"$msg\" | grep -F -q \"Signed-off-by: ${committer}\"\n \t\tthen\n \t\t\techo >&2 \"Missing committer Signed-off-by in commit $commit\"\n \t\t\terrors=$((errors+1))\n@@ -79,21 +79,21 @@ do\n \n \t\tauthor=$(echo \"$msg\" | grep '^author ' | head -1 | \\\n \t\t\t\tcut -d ' ' -f 2- | rev | cut -d ' ' -f 3- | rev)\n-\t\tif ! echo \"$msg\" | grep -F -q \"Signed-off-by: ${author}\"\n+\t\tif ! echo -E \"$msg\" | grep -F -q \"Signed-off-by: ${author}\"\n \t\tthen\n \t\t\techo >&2 \"Missing author Signed-off-by in commit $commit\"\n \t\t\terrors=$((errors+1))\n \t\tfi\n \n \t\t# 3. A Reviewed-by or Acked-by is required.\n-\t\tif ! echo \"$msg\" | grep -q '^\\(Reviewed\\|Acked\\)-by: '\n+\t\tif ! echo -E \"$msg\" | grep -q '^\\(Reviewed\\|Acked\\)-by: '\n \t\tthen\n \t\t\techo >&2 \"No Reviewed-by or Acked-by in commit $commit\"\n \t\t\terrors=$((errors+1))\n \t\tfi\n \n \t\t# 4. The commit message shall not contain a Change-Id.\n-\t\tif echo \"$msg\" | grep -q '^Change-Id:'\n+\t\tif echo -E \"$msg\" | grep -q '^Change-Id:'\n \t\tthen\n \t\t\techo >&2 \"Found Change-Id in commit $commit\"\n \t\t\terrors=$((errors+1))\n", "prefixes": [ "libcamera-devel" ] }