get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 871861,
    "url": "http://patchwork.ozlabs.org/api/patches/871861/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/lede/patch/1518404425-50957-1-git-send-email-yszhou4tech@gmail.com/",
    "project": {
        "id": 54,
        "url": "http://patchwork.ozlabs.org/api/projects/54/?format=api",
        "name": "LEDE development",
        "link_name": "lede",
        "list_id": "lede-dev.lists.infradead.org",
        "list_email": "lede-dev@lists.infradead.org",
        "web_url": "http://lede-project.org/",
        "scm_url": "",
        "webscm_url": "http://git.lede-project.org/",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1518404425-50957-1-git-send-email-yszhou4tech@gmail.com>",
    "list_archive_url": null,
    "date": "2018-02-12T03:00:24",
    "name": "[LEDE-DEV,v2,procd,1/2] service: add func for string config change check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "28e6f27be0e8e318a71bda319e6286823561c51f",
    "submitter": {
        "id": 65295,
        "url": "http://patchwork.ozlabs.org/api/people/65295/?format=api",
        "name": "Yousong Zhou",
        "email": "yszhou4tech@gmail.com"
    },
    "delegate": {
        "id": 54613,
        "url": "http://patchwork.ozlabs.org/api/users/54613/?format=api",
        "username": "blogic",
        "first_name": "John",
        "last_name": "Crispin",
        "email": "blogic@openwrt.org"
    },
    "mbox": "http://patchwork.ozlabs.org/project/lede/patch/1518404425-50957-1-git-send-email-yszhou4tech@gmail.com/mbox/",
    "series": [
        {
            "id": 28001,
            "url": "http://patchwork.ozlabs.org/api/series/28001/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/lede/list/?series=28001",
            "date": "2018-02-12T03:00:25",
            "name": "[LEDE-DEV,v2,procd,1/2] service: add func for string config change check",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/28001/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/871861/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/871861/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org; spf=none (mailfrom)\n\tsmtp.mailfrom=lists.infradead.org\n\t(client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org;\n\tenvelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=infradead.org header.i=@infradead.org\n\theader.b=\"oGGUwiJX\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org header.b=\"mTQb2a1I\"; \n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"IPnYkx91\"; dkim-atps=neutral"
        ],
        "Received": [
            "from casper.infradead.org (casper.infradead.org\n\t[IPv6:2001:8b0:10b:1236::1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3zfrYM6mmqz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 12 Feb 2018 14:21:27 +1100 (AEDT)",
            "from [198.137.202.133] (helo=bombadil.infradead.org)\n\tby casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux))\n\tid 1el4g1-00030z-Rh\n\tfor incoming@patchwork.ozlabs.org; Mon, 12 Feb 2018 03:21:10 +0000",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux))\n\tid 1el4Nx-0002YK-Fv; Mon, 12 Feb 2018 03:02:29 +0000",
            "from mail-ua0-x244.google.com ([2607:f8b0:400c:c08::244])\n\tby bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux))\n\tid 1el4Nu-0002XK-Ij\n\tfor lede-dev@lists.infradead.org; Mon, 12 Feb 2018 03:02:27 +0000",
            "by mail-ua0-x244.google.com with SMTP id p12so8636088uad.0\n\tfor <lede-dev@lists.infradead.org>;\n\tSun, 11 Feb 2018 19:02:16 -0800 (PST)",
            "from titan2.office.mos ([104.238.138.31])\n\tby smtp.gmail.com with ESMTPSA id\n\ta12sm1035016uak.41.2018.02.11.19.02.10\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 11 Feb 2018 19:02:12 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=casper.20170209;\n\th=Sender:Content-Transfer-Encoding:\n\tContent-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive:\n\tList-Unsubscribe:List-Id:Subject:Message-Id:Date:To:From:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:In-Reply-To:References:List-Owner;\n\tbh=I+UY6q5VaN1XCFNfMBuMS5w+8xiv1QZ4pMbxEipAhgw=;\n\tb=oGGUwiJXztg/fdXNRC/qKez11E\n\t2uQJZChAMb2357xlRehOzxzXks5E7COa5xxeVrIK45kWcosNKbn9Sq25ZagH8Ex3X46Mvqyiab0UK\n\t7GLu34xyjKulyfuDPY7jFrmYvQlnjAZ+ftw9O8oxqiuf8YsypBm6xxX9y+4tIYsfWsjp62AXytkjC\n\th7ABvI9cahWFKKpuSOyQl0BVt1IdOsK3GweBogBcB6185n1ss2IQLuaxo+YZ8/t4UcbwFyfvZ48Oj\n\t6D2Ft7WjxQVxuegNnPYUuQ5JmAc8z7skm7BhEgxV5hhDneohEjOMLO3Q547Osjl688vNI8W2Tx9b3\n\tEyhi8Tlw==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe:\n\tList-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:\n\tDate:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=I+UY6q5VaN1XCFNfMBuMS5w+8xiv1QZ4pMbxEipAhgw=;\n\tb=mTQb2a1IQrj0jQ\n\t4T3BmtTuu42S8od7eNUyxgILoBVFjMfxnwBVUwrTS3F/yhlBJKK2VmOJXJvFAz1OObzhbfXdtZevn\n\texEaqtikK2kwBXsMgMPOvPgXV95EMTxCnPKhh3HExe4Z14DLDyJeTH+krT3vUrKi2I/rHjutggJrh\n\tDz/yV5RGrR8od8U4taOcB7PkmxtUVEi8DQHVd7gaW5PRL/C5KvSCfcQU+IYSyn2zhaRjYtJcqBilM\n\t8qIxpjradqSL9JC3zxr4F5ftn0pg+pYzo87BlNqt05rBHljPEdAWiUKzEQWc+CltHK+fsSZdw9J52\n\tduVUz1No+BpBdD/BAZMg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=ruCa5Zrtz3AtJ6TRBmRZrGGrlQmpabqLo+A+Lp9W+rI=;\n\tb=IPnYkx913qNIGLYz6L+FFyxvnZloDHgQ5fckGvmhyUKMwIYWW2wrFgs9WD6OSv4GSY\n\t3yZv7EoPQ/3N6ulXaLjk3FE+RwaJFqOFu5qQvp8WCqwNPp1uD+PgbT/5ZxaR+XHDNqnV\n\tkhqqPdvt2AYSBjSyi6jAugS2LmdHxorHkrJqCDLYc4OnwFYm+Ysm8JAQZVB0JOReClrl\n\tEMJ9r6l7u5ZZ1pqLeGSEbg/q03yfOe0Q/WajF64Z/qcEZDoRNcrCkvJG1ycqS5qbaskM\n\tlglo3mf6AzOFIUBicZIH4O4RLyaOO2BidxcNbimW2ohKFd23wpofIBrwCHK/aMcFjE5p\n\tlEMg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=ruCa5Zrtz3AtJ6TRBmRZrGGrlQmpabqLo+A+Lp9W+rI=;\n\tb=RenVOY7TTHiNC1zuvQQKc18LowfilF1f5y0si2sVtDc/o/ie8LO+zIwHjLaluy5Gjb\n\tsncczSOpJ+d5YPnqAHLBGa38vkK/tTLAFKpyXdcqP1eQ7Xnlr7Hs9RhYjNLHCAF/mMjm\n\tyUFli7BUyvrAqosww5NU6blFKU0HZB3z7U4oqb3Ie5u0TRLMYRGtAD8JfOhskGnxpox4\n\tElofkKNO4IhvQJPzjxQVf7cl28gFej528HXHyACe8gn8a/RsoWneKRCXJvrGtmQAcVo6\n\tWZu3VD1jIdKlKWl6+co+7Ftq1+UCX8sA2AnbtWY/6s3EvYDpzypGEbTzBaOOrLBfntZQ\n\tD2DQ==",
        "X-Gm-Message-State": "APf1xPD2QCoHUxyU/SJAXomUIZwrzHmM5iAYs7Gcwbx94Mhy24N+LWRS\n\toqeBBklAa0Hi71FrMAM4sbg=",
        "X-Google-Smtp-Source": "AH8x227u6OAoFD/beDha2RMYIiP3ayoK3P+StUOzu1HiSBc2tkVVzGoIc3BVW7kswh7xWe9bPdIX1w==",
        "X-Received": "by 10.159.47.17 with SMTP id x17mr10751152uaj.114.1518404533141; \n\tSun, 11 Feb 2018 19:02:13 -0800 (PST)",
        "From": "Yousong Zhou <yszhou4tech@gmail.com>",
        "To": "john@phrozen.org",
        "Date": "Mon, 12 Feb 2018 11:00:24 +0800",
        "Message-Id": "<1518404425-50957-1-git-send-email-yszhou4tech@gmail.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "X-Spam-Note": "CRM114 invocation failed",
        "X-Spam-Score": "-2.0 (--)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-2.0 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/,\n\tno\n\ttrust [2607:f8b0:400c:c08:0:0:0:244 listed in] [list.dnswl.org]\n\t0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n\tprovider (yszhou4tech[at]gmail.com)\n\t-0.0 SPF_PASS               SPF: sender matches SPF record\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]\n\t-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature\n\t0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n\tnot necessarily valid\n\t-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n\tauthor's domain",
        "Subject": "[LEDE-DEV] [PATCH v2][procd 1/2] service: add func for string\n\tconfig change check",
        "X-BeenThere": "lede-dev@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<lede-dev.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/lede-dev/>",
        "List-Post": "<mailto:lede-dev@lists.infradead.org>",
        "List-Help": "<mailto:lede-dev-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/lede-dev>,\n\t<mailto:lede-dev-request@lists.infradead.org?subject=subscribe>",
        "Cc": "Yousong Zhou <yszhou4tech@gmail.com>, lede-dev@lists.infradead.org",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"Lede-dev\" <lede-dev-bounces@lists.infradead.org>",
        "Errors-To": "lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "To also prepare for following commits introducing more string value\nchange detection\n\nSigned-off-by: Yousong Zhou <yszhou4tech@gmail.com>\n---\n service/instance.c | 14 ++++++--------\n 1 file changed, 6 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/service/instance.c b/service/instance.c\nindex 12c2efe..c3f8b56 100644\n--- a/service/instance.c\n+++ b/service/instance.c\n@@ -588,6 +588,11 @@ instance_restart(struct service_instance *in)\n \tuloop_timeout_set(&in->timeout, in->term_timeout * 1000);\n }\n \n+static bool string_changed(const char *a, const char *b)\n+{\n+\treturn !((!a && !b) || (a && b && !strcmp(a, b)));\n+}\n+\n static bool\n instance_config_changed(struct service_instance *in, struct service_instance *in_new)\n {\n@@ -615,14 +620,7 @@ instance_config_changed(struct service_instance *in, struct service_instance *in\n \tif (in->gid != in_new->gid)\n \t\treturn true;\n \n-\tif (in->pidfile && in_new->pidfile)\n-\t\tif (strcmp(in->pidfile, in_new->pidfile))\n-\t\t\treturn true;\n-\n-\tif (in->pidfile && !in_new->pidfile)\n-\t\treturn true;\n-\n-\tif (!in->pidfile && in_new->pidfile)\n+\tif (string_changed(in->pidfile, in_new->pidfile))\n \t\treturn true;\n \n \tif (in->respawn_retry != in_new->respawn_retry)\n",
    "prefixes": [
        "LEDE-DEV",
        "v2",
        "procd",
        "1/2"
    ]
}