get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/117134/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 117134,
    "url": "https://patches.dpdk.org/api/patches/117134/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220929120403.352-1-olivier.matz@6wind.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220929120403.352-1-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220929120403.352-1-olivier.matz@6wind.com",
    "date": "2022-09-29T12:04:03",
    "name": "devtools: fix checkpatches subject retrieval from stdin",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7c5cb305fe32674242665ef61da4f1e12cade32e",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220929120403.352-1-olivier.matz@6wind.com/mbox/",
    "series": [
        {
            "id": 24912,
            "url": "https://patches.dpdk.org/api/series/24912/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24912",
            "date": "2022-09-29T12:04:03",
            "name": "devtools: fix checkpatches subject retrieval from stdin",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/24912/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/117134/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/117134/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 35AC9A00C4;\n\tThu, 29 Sep 2022 14:04:58 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2A73340FAE;\n\tThu, 29 Sep 2022 14:04:58 +0200 (CEST)",
            "from mail-wr1-f54.google.com (mail-wr1-f54.google.com\n [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 629D340FAE\n for <dev@dpdk.org>; Thu, 29 Sep 2022 14:04:57 +0200 (CEST)",
            "by mail-wr1-f54.google.com with SMTP id m4so1849159wrr.5\n for <dev@dpdk.org>; Thu, 29 Sep 2022 05:04:57 -0700 (PDT)",
            "from gojira.dev.6wind.com ([185.13.181.2])\n by smtp.gmail.com with ESMTPSA id\n l18-20020a05600c1d1200b003a601a1c2f7sm4448251wms.19.2022.09.29.05.04.56\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 29 Sep 2022 05:04:56 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date;\n bh=kmCLWOeCX4eUKQgs0m7qdca0LfbjZJH4px/PD+l1so4=;\n b=anE98cHDLS2iriULAAwuSid+fs62Vu9eE3Vct4bUYMjQGv3C8N8QyLdKJlNUXgyUMG\n SMMKkyFaxxM9zfTmPXuXopIPLxvOsMLL49CC2diSxri6ZtQXELS+B+OjrvLaLrUPhqNq\n f6/Hkl6UDNXevOw0ONL/bSmPBvakch+wH7EtppBMdIPOjXERePFvuGFbCQdbn6YixZeR\n zC+pEYPhrpZHAfWZlnUWANoyP/eu1tsXe77iNjfs35QSgDoCcW67jrB1/mBltBjI7gR9\n HpDYl2WvsL9Y3CS8dYPW9WHWkhzLP0kYlQO4uV1yTOg/ntk2sX/YQs/1U9rhZKQlj4GG\n xUaQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date;\n bh=kmCLWOeCX4eUKQgs0m7qdca0LfbjZJH4px/PD+l1so4=;\n b=76ge7o6cB4TsbEUkzZjeYF514a4FzM0pd3VQAJEg5XZexoeiYmHC1VW3GMtrQ9HKQP\n PTGdYlQlecptK6nnT+/ozexvCaSW0PQ0a4vt2VCHPSyrzaDBAM8c/pbVJF7za/ijjVWT\n rKSGrXRL4HjU0O6HDV9s3CyCjv6aBiUIW5eSaLN/x39Jw8E6tjtoyumLwHY25/RyAVIN\n SBFgVewF4R/XBEVPs6X8wO9adt+Y8yISnN+EHO4dxI5ykWPr+N2vyvQopjMLK+Ljs8j8\n kKEdMGhFcbEHcRgqYPa9QSbLj+6E0ATnR00ZfEmDQbqiEJPJSOk9+AqNKIiiQsQQ+3Wn\n VglA==",
        "X-Gm-Message-State": "ACrzQf0sG68uk/JqJGQPGbZFEaRXvXPQ2MXn9Zv9S8YoN8QXhaVEu3Mq\n 9KGh9Jho2cA+x+n3WPTEr77ycoMvEIKPKaJs",
        "X-Google-Smtp-Source": "\n AMsMyM4IJWov6RZ56g0ehqmdyKNNwYt74Tnu0BkeVw1yAWMd9XfaLJlBRSzUAEL7sUO3DcTz4tQQeg==",
        "X-Received": "by 2002:a5d:504a:0:b0:228:a1ae:2038 with SMTP id\n h10-20020a5d504a000000b00228a1ae2038mr2023635wrt.645.1664453097053;\n Thu, 29 Sep 2022 05:04:57 -0700 (PDT)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Thomas Monjalon <thomas@monjalon.net>,\n\tstable@dpdk.org",
        "Subject": "[PATCH] devtools: fix checkpatches subject retrieval from stdin",
        "Date": "Thu, 29 Sep 2022 14:04:03 +0200",
        "Message-Id": "<20220929120403.352-1-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "When passing the patch to checkpatches.sh through stdin, the subject is\nretrieved by reading the input until a \"Subject:\" entry is found. The\nrest of the input is piped to checkpatch.pl.\n\nSince the \"From:\" line is before the \"Subject:\" line, it won't be sent to\ncheckpatch.pl, which won't be able to get the author of the commit.\nThe following error will appear:\n\n> ERROR:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal patch author ''\n\nDo the subject lookup on the temporary file instead of stdin, and\nsend the whole lines to checkpatch.pl.\n\nThe problem is visible since the introduction of this check in linux\ncheckpatch.pl in version 4.19 (see link below).\n\nLink: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cd2614967d8b\nFixes: 8005feef421d (\"scripts: add standard input to checkpatch\")\nCC: stable@dpdk.org\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n devtools/checkpatches.sh | 37 +++++++++++++++----------------------\n 1 file changed, 15 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh\nindex 0e82c01947..2b7005dfac 100755\n--- a/devtools/checkpatches.sh\n+++ b/devtools/checkpatches.sh\n@@ -278,12 +278,12 @@ print_headline() { # <title>\n total=0\n status=0\n \n-check () { # <patch> <commit> <title>\n+check () { # <patch-file> <commit>\n \tlocal ret=0\n+\tlocal subject=''\n \theadline_printed=false\n \n \ttotal=$(($total + 1))\n-\t! $verbose || print_headline \"$3\"\n \tif [ -n \"$1\" ] ; then\n \t\ttmpinput=$1\n \telse\n@@ -298,10 +298,14 @@ check () { # <patch> <commit> <title>\n \t\tfi\n \tfi\n \n+\t# Subject can be on 2 lines\n+\tsubject=$(sed '/^Subject: */!d;s///;N;s,\\n[[:space:]]\\+, ,;s,\\n.*,,;q' \"$tmpinput\")\n+\t! $verbose || print_headline \"$subject\"\n+\n \t! $verbose || printf 'Running checkpatch.pl:\\n'\n \treport=$($DPDK_CHECKPATCH_PATH $options \"$tmpinput\" 2>/dev/null)\n \tif [ $? -ne 0 ] ; then\n-\t\t$headline_printed || print_headline \"$3\"\n+\t\t$headline_printed || print_headline \"$subject\"\n \t\tprintf '%s\\n' \"$report\" | sed -n '1,/^total:.*lines checked$/p'\n \t\tret=1\n \tfi\n@@ -309,7 +313,7 @@ check () { # <patch> <commit> <title>\n \t! $verbose || printf '\\nChecking API additions/removals:\\n'\n \treport=$($VALIDATE_NEW_API \"$tmpinput\")\n \tif [ $? -ne 0 ] ; then\n-\t\t$headline_printed || print_headline \"$3\"\n+\t\t$headline_printed || print_headline \"$subject\"\n \t\tprintf '%s\\n' \"$report\"\n \t\tret=1\n \tfi\n@@ -317,7 +321,7 @@ check () { # <patch> <commit> <title>\n \t! $verbose || printf '\\nChecking forbidden tokens additions:\\n'\n \treport=$(check_forbidden_additions \"$tmpinput\")\n \tif [ $? -ne 0 ] ; then\n-\t\t$headline_printed || print_headline \"$3\"\n+\t\t$headline_printed || print_headline \"$subject\"\n \t\tprintf '%s\\n' \"$report\"\n \t\tret=1\n \tfi\n@@ -325,7 +329,7 @@ check () { # <patch> <commit> <title>\n \t! $verbose || printf '\\nChecking __rte_experimental tags:\\n'\n \treport=$(check_experimental_tags \"$tmpinput\")\n \tif [ $? -ne 0 ] ; then\n-\t\t$headline_printed || print_headline \"$3\"\n+\t\t$headline_printed || print_headline \"$subject\"\n \t\tprintf '%s\\n' \"$report\"\n \t\tret=1\n \tfi\n@@ -333,7 +337,7 @@ check () { # <patch> <commit> <title>\n \t! $verbose || printf '\\nChecking __rte_internal tags:\\n'\n \treport=$(check_internal_tags \"$tmpinput\")\n \tif [ $? -ne 0 ] ; then\n-\t\t$headline_printed || print_headline \"$3\"\n+\t\t$headline_printed || print_headline \"$subject\"\n \t\tprintf '%s\\n' \"$report\"\n \t\tret=1\n \tfi\n@@ -341,7 +345,7 @@ check () { # <patch> <commit> <title>\n \t! $verbose || printf '\\nChecking release notes updates:\\n'\n \treport=$(check_release_notes \"$tmpinput\")\n \tif [ $? -ne 0 ] ; then\n-\t\t$headline_printed || print_headline \"$3\"\n+\t\t$headline_printed || print_headline \"$subject\"\n \t\tprintf '%s\\n' \"$report\"\n \t\tret=1\n \tfi\n@@ -357,20 +361,10 @@ check () { # <patch> <commit> <title>\n \n if [ -n \"$1\" ] ; then\n \tfor patch in \"$@\" ; do\n-\t\t# Subject can be on 2 lines\n-\t\tsubject=$(sed '/^Subject: */!d;s///;N;s,\\n[[:space:]]\\+, ,;s,\\n.*,,;q' \"$patch\")\n-\t\tcheck \"$patch\" '' \"$subject\"\n+\t\tcheck \"$patch\" ''\n \tdone\n elif [ ! -t 0 ] ; then # stdin\n-\tsubject=$(while read header value ; do\n-\t\tif [ \"$header\" = 'Subject:' ] ; then\n-\t\t\tIFS= read next\n-\t\t\tcontinuation=$(echo \"$next\" | sed -n 's,^[[:space:]]\\+, ,p')\n-\t\t\techo $value$continuation\n-\t\t\tbreak\n-\t\tfi\n-\tdone)\n-\tcheck '' '' \"$subject\"\n+\tcheck '' ''\n else\n \tif [ $number -eq 0 ] ; then\n \t\tcommits=$(git rev-list --reverse $range)\n@@ -378,8 +372,7 @@ else\n \t\tcommits=$(git rev-list --reverse --max-count=$number HEAD)\n \tfi\n \tfor commit in $commits ; do\n-\t\tsubject=$(git log --format='%s' -1 $commit)\n-\t\tcheck '' $commit \"$subject\"\n+\t\tcheck '' $commit\n \tdone\n fi\n pass=$(($total - $status))\n",
    "prefixes": []
}