get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12012,
    "url": "http://patches.dpdk.org/api/patches/12012/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1460389145-5570-1-git-send-email-thomas.monjalon@6wind.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1460389145-5570-1-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1460389145-5570-1-git-send-email-thomas.monjalon@6wind.com",
    "date": "2016-04-11T15:39:05",
    "name": "[dpdk-dev,v2] scripts: check commit formatting",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2d51a867aeb1aae8a8b8ff2a8bb57fabaa096e23",
    "submitter": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1460389145-5570-1-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/12012/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/12012/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B8F61293B;\n\tMon, 11 Apr 2016 17:39:12 +0200 (CEST)",
            "from mail-wm0-f42.google.com (mail-wm0-f42.google.com\n\t[74.125.82.42]) by dpdk.org (Postfix) with ESMTP id A16432931\n\tfor <dev@dpdk.org>; Mon, 11 Apr 2016 17:39:11 +0200 (CEST)",
            "by mail-wm0-f42.google.com with SMTP id u206so109935598wme.1\n\tfor <dev@dpdk.org>; Mon, 11 Apr 2016 08:39:11 -0700 (PDT)",
            "from XPS13.localdomain (245.111.75.86.rev.sfr.net. [86.75.111.245])\n\tby smtp.gmail.com with ESMTPSA id\n\ts6sm8938661wjy.31.2016.04.11.08.39.09 for <dev@dpdk.org>\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tMon, 11 Apr 2016 08:39:10 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:subject:date:message-id:in-reply-to:references;\n\tbh=eaI7vNtqKsmznpTWQOpYZXty5NAXE571OJ+C+SdvVEE=;\n\tb=co5P56pKdZSmYH9KhuL6QMLs/l8MCSGNbB5dhnDbXhME6qwYRffXoAuRYhXackMJOB\n\tS6AeVaYz7lmy9aPSKqGNnlFS4zIlxWFOSqyY1gnl6tcaRFZa7NMGVVri23OPlCeZlqd1\n\tTg4INCn0RYb1JaMUjJvj4mCg8LcGsuG2UsZYmAQsAt6BlPlFmKDYiuFzkhpIwBNBjVDn\n\tfj7toRDdKu7LK466yzbr3e81MGoboa3kS8P5TKYVWO+rNSJRTKYBMH2ZwItCIffMpEoo\n\t4pLq+fXm9Ir9QpcNl4rTzcbGxqVVVPx/vp2mj9CSP9ni5lu0mZHlpsRcrGZC4HqL1c2B\n\tcZBQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=eaI7vNtqKsmznpTWQOpYZXty5NAXE571OJ+C+SdvVEE=;\n\tb=QRNAAGS0/vLUl0/XUQMyXsMWMi/elsgmvmuADNBh9Sj5xUdydtWRNc/KldtiaYcST7\n\t2f+9d4YkvRY4mjbB2GvksQj5T1nRU3velzxKTV6yCfH10CHKNLuwvhXngUvMKPxPmLYe\n\tQ7nV/g1YP9ePUyybevhm9shb0BnSupWBrZ4aXAqGrJDyVVjyhhXbh57EXkOH1BhGcCJ6\n\tqFYRIwyoVjVBBPosAGwexp/jnIIbkJw8E3HoSc962yJE6BHX6JMsyrw5bhlIsfvwPYHa\n\t7RGNYc7xnBgz8+HUmxHSrL5Zwpz0CioCPR6quWu0e2dsW7RLEEStLntqMnx7vRy9Utm2\n\tk6Fw==",
        "X-Gm-Message-State": "AD7BkJJljp7kF4pH0yP1TGAhNn7KauluqY14dgktYInjY4m5kJ/gxk27jNC6o+ZdAQ4fnkJQ",
        "X-Received": "by 10.28.153.203 with SMTP id b194mr19788353wme.3.1460389151389; \n\tMon, 11 Apr 2016 08:39:11 -0700 (PDT)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 11 Apr 2016 17:39:05 +0200",
        "Message-Id": "<1460389145-5570-1-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.7.0",
        "In-Reply-To": "<1459286986-31148-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1459286986-31148-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v2] scripts: check commit formatting",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The git messages have three parts:\n1/ the headline\n2/ the explanations\n3/ the footer tags\n\nThe headline helps to quickly browse an history or catch instantly the\npurpose of a commit. Making it short with some consistent wording\nallows to easily parse it or match some patterns.\n\nThe explanations must give some keys like the reason of the change.\nNothing can be automatically checked for this part, except line length.\n\nThe footer contains some tags to find the origin of a bug or who\nwas working on it.\n\nThis script is doing some basic checks mostly on parts 1 and 3.\n\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n MAINTAINERS                         |   1 +\n doc/guides/contributing/patches.rst |   8 +++\n scripts/check-git-log.sh            | 140 ++++++++++++++++++++++++++++++++++++\n 3 files changed, 149 insertions(+)\n create mode 100755 scripts/check-git-log.sh\n\nv2:\n- accept not only 12 long hash in Fixes:\n- check line length\n- add doc",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex f213500..1953ea2 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -25,6 +25,7 @@ M: Thomas Monjalon <thomas.monjalon@6wind.com>\n T: git://dpdk.org/dpdk\n F: MAINTAINERS\n F: scripts/check-maintainers.sh\n+F: scripts/check-git-log.sh\n F: scripts/checkpatches.sh\n F: scripts/load-devel-config.sh\n F: scripts/test-build.sh\ndiff --git a/doc/guides/contributing/patches.rst b/doc/guides/contributing/patches.rst\nindex 3ebe95b..06af91d 100644\n--- a/doc/guides/contributing/patches.rst\n+++ b/doc/guides/contributing/patches.rst\n@@ -258,6 +258,14 @@ Where:\n * ``-v``: verbose.\n * ``patchX``: path to one or more patches.\n \n+Then the git logs should be checked using the ``check-git-log.sh`` script.\n+\n+The script usage is::\n+\n+   check-git-log.sh [range]\n+\n+Where the range is a ``git log`` option.\n+\n \n .. _contrib_check_compilation:\n \ndiff --git a/scripts/check-git-log.sh b/scripts/check-git-log.sh\nnew file mode 100755\nindex 0000000..ce6c15e\n--- /dev/null\n+++ b/scripts/check-git-log.sh\n@@ -0,0 +1,140 @@\n+#! /bin/sh\n+\n+# BSD LICENSE\n+#\n+# Copyright 2016 6WIND S.A.\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions\n+# are met:\n+#\n+#   * Redistributions of source code must retain the above copyright\n+#     notice, this list of conditions and the following disclaimer.\n+#   * Redistributions in binary form must reproduce the above copyright\n+#     notice, this list of conditions and the following disclaimer in\n+#     the documentation and/or other materials provided with the\n+#     distribution.\n+#   * Neither the name of 6WIND S.A. nor the names of its\n+#     contributors may be used to endorse or promote products derived\n+#     from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+# \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+# Check commit logs (headlines and references)\n+#\n+# If any doubt about the formatting, please check in the most recent history:\n+#\tgit log --format='%>|(15)%cr   %s' --reverse | grep -i <pattern>\n+\n+if [ \"$1\" = '-h' -o \"$1\" = '--help' ] ; then\n+\tcat <<- END_OF_HELP\n+\tusage: $(basename $0) [-h] [range]\n+\n+\tCheck commit log formatting.\n+\tThe git range can be specified as a \"git log\" option,\n+\te.g. -1 to check only the latest commit.\n+\tThe default range starts from origin/master to HEAD.\n+\tEND_OF_HELP\n+\texit\n+fi\n+\n+range=${1:-origin/master..}\n+\n+headlines=$(git log --format='%s' $range)\n+bodylines=$(git log --format='%b' $range)\n+tags=$(git log --format='%b' $range | grep -i -e 'by *:' -e 'fix.*:')\n+fixes=$(git log --format='%h %s' $range | grep -i ': *fix' | cut -d' ' -f1)\n+\n+# check headline format (spacing, no punctuation, no code)\n+bad=$(echo \"$headlines\" | grep \\\n+\t-e '\t' \\\n+\t-e '^ ' \\\n+\t-e ' $' \\\n+\t-e '\\.$' \\\n+\t-e '[,;!?&|]' \\\n+\t-e ':.*_' \\\n+\t-e '^[^:]*$' \\\n+\t-e ':[^ ]' \\\n+\t-e ' :' \\\n+\t| sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Wrong headline format:\\n$bad\\n\"\n+\n+# check headline label for common typos\n+bad=$(echo \"$headlines\" | grep \\\n+\t-e '^example[:/]' \\\n+\t-e '^apps/' \\\n+\t-e '^testpmd' \\\n+\t-e 'test-pmd' \\\n+\t-e '^bond:' \\\n+\t| sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Wrong headline label:\\n$bad\\n\"\n+\n+# check headline lowercase for first words\n+bad=$(echo \"$headlines\" | grep \\\n+\t-e '^.*[A-Z].*:' \\\n+\t-e ': *[A-Z]' \\\n+\t| sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Wrong headline uppercase:\\n$bad\\n\"\n+\n+# check headline uppercase (Rx/Tx, VF, L2, MAC, Linux, ARM...)\n+bad=$(echo \"$headlines\" | grep \\\n+\t-e 'rx\\|tx\\|RX\\|TX' \\\n+\t-e '\\<[pv]f\\>' \\\n+\t-e '\\<l[234]\\>' \\\n+\t-e ':.*\\<dma\\>' \\\n+\t-e ':.*\\<pci\\>' \\\n+\t-e ':.*\\<mtu\\>' \\\n+\t-e ':.*\\<mac\\>' \\\n+\t-e ':.*\\<vlan\\>' \\\n+\t-e ':.*\\<rss\\>' \\\n+\t-e ':.*\\<freebsd\\>' \\\n+\t-e ':.*\\<linux\\>' \\\n+\t-e ':.*\\<tilegx\\>' \\\n+\t-e ':.*\\<tile-gx\\>' \\\n+\t-e ':.*\\<arm\\>' \\\n+\t-e ':.*\\<armv7\\>' \\\n+\t-e ':.*\\<armv8\\>' \\\n+\t| sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Wrong headline lowercase:\\n$bad\\n\"\n+\n+# check headline length (60 max)\n+bad=$(echo \"$headlines\" | awk 'length>60 {print}' | sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Headline too long:\\n$bad\\n\"\n+\n+# check body lines length (75 max)\n+bad=$(echo \"$bodylines\" | awk 'length>75 {print}' | sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Line too long:\\n$bad\\n\"\n+\n+# check tags spelling\n+bad=$(echo \"$tags\" |\n+\tgrep -v '^\\(Reported\\|Suggested\\|Signed-off\\|Acked\\|Reviewed\\|Tested\\)-by: [^,]* <.*@.*>$' |\n+\tgrep -v '^Fixes: [0-9a-f]\\{7\\}[0-9a-f]* (\".*\")$' |\n+\tsed 's,^.,\\t&,')\n+[ -z \"$bad\" ] || printf \"Wrong tag:\\n$bad\\n\"\n+\n+# check missing Fixes: tag\n+bad=$(for fix in $fixes ; do\n+\tgit log --format='%b' -1 $fix | grep -q '^Fixes: ' ||\n+\t\tgit log --format='\\t%s' -1 $fix\n+done)\n+[ -z \"$bad\" ] || printf \"Missing 'Fixes' tag:\\n$bad\\n\"\n+\n+# check Fixes: reference\n+IFS='\n+'\n+fixtags=$(echo \"$tags\" | grep '^Fixes: ')\n+bad=$(for fixtag in $fixtags ; do\n+\thash=$(echo \"$fixtag\" | sed 's,^Fixes: \\([0-9a-f]*\\).*,\\1,')\n+\tgood=\"Fixes: $hash \"$(git log --format='(\"%s\")' -1 $hash 2>&-)\n+\tprintf \"$fixtag\" | grep -v \"^$good$\"\n+done | sed 's,^,\\t,')\n+[ -z \"$bad\" ] || printf \"Wrong 'Fixes' reference:\\n$bad\\n\"\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}