Patch Detail
Show a patch.
GET /api/1.1/patches/3326/?format=api
{ "id": 3326, "url": "https://patchwork.libcamera.org/api/1.1/patches/3326/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3326/", "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": "<20200326114920.4716-1-laurent.pinchart@ideasonboard.com>", "date": "2020-03-26T11:49:20", "name": "[libcamera-devel] utils: hooks: Add pre-push commit hook", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5470acab24a5a2a1d52e16edd42a205603af68b4", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3326/mbox/", "series": [ { "id": 780, "url": "https://patchwork.libcamera.org/api/1.1/series/780/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=780", "date": "2020-03-26T11:49:20", "name": "[libcamera-devel] utils: hooks: Add pre-push commit hook", "version": 1, "mbox": "https://patchwork.libcamera.org/series/780/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3326/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3326/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2515A60410\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Mar 2020 12:49:28 +0100 (CET)", "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9B5192DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Mar 2020 12:49:27 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TokUd3g6\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1585223367;\n\tbh=aCc6lpIwjV619u08R7xQRKYnKL+RbSiTxyTdeOuMNiI=;\n\th=From:To:Subject:Date:From;\n\tb=TokUd3g6FBQ3EwkaH+Z/SGNl4maNK1ntqY7WCTIzJzTHTBSmsRCBzJtAQc2V+vE9L\n\ty1ve8y/4/TgAxrHehTxqRLJnqbpDYLygEKVFud7NVqCU/E0R2NepNjuUfGUBF6pUWs\n\t/F9+BNPVBYywfc1l3XtH4m0tb3Ysd5xGjuMVhHaw=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 26 Mar 2020 13:49:20 +0200", "Message-Id": "<20200326114920.4716-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.24.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] utils: hooks: Add pre-push commit hook", "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>", "X-List-Received-Date": "Thu, 26 Mar 2020 11:49:28 -0000" }, "content": "Add a pre-push commit hooks to prevent unintentional push of patches\ncontaining local changelogs to the master branch.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n utils/hooks/pre-push | 59 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 59 insertions(+)\n create mode 100755 utils/hooks/pre-push", "diff": "diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push\nnew file mode 100755\nindex 000000000000..dc054b2553ff\n--- /dev/null\n+++ b/utils/hooks/pre-push\n@@ -0,0 +1,59 @@\n+#!/bin/sh\n+\n+# A hook script to verify what is about to be pushed. Called by \"git\n+# push\" after it has checked the remote status, but before anything has been\n+# pushed. If this script exits with a non-zero status nothing will be pushed.\n+#\n+# This hook is called with the following parameters:\n+#\n+# $1 -- Name of the remote to which the push is being done\n+# $2 -- URL to which the push is being done\n+#\n+# If pushing without using a named remote those arguments will be equal.\n+#\n+# Information about the commits which are being pushed is supplied as lines to\n+# the standard input in the form:\n+#\n+# <local ref> <local sha1> <remote ref> <remote sha1>\n+#\n+# This script prevents push of commits than contain a local changelog to the\n+# master branch.\n+\n+remote=\"$1\"\n+url=\"$2\"\n+\n+z40=0000000000000000000000000000000000000000\n+\n+while read local_ref local_sha remote_ref remote_sha\n+do\n+\tif [ \"$remote_ref\" != refs/heads/master ]\n+\tthen\n+\t\tcontinue\n+\tfi\n+\n+\tif [ \"$local_sha\" = $z40 ]\n+\tthen\n+\t\t# Handle delete\n+\t\t:\n+\telse\n+\t\tif [ \"$remote_sha\" = $z40 ]\n+\t\tthen\n+\t\t\t# New branch, examine all commits\n+\t\t\trange=\"$local_sha\"\n+\t\telse\n+\t\t\t# Update to existing branch, examine new commits\n+\t\t\trange=\"$remote_sha..$local_sha\"\n+\t\tfi\n+\n+\t\t# Check for WIP commit\n+\t\tcommit=`git rev-list -n 1 --grep '^---' \"$range\"`\n+\t\tif [ -n \"$commit\" ]\n+\t\tthen\n+\t\t\techo >&2 \"Found local changelog in $local_ref, not pushing\"\n+\t\t\techo >&2 \"Check commit $commit\"\n+\t\t\texit 1\n+\t\tfi\n+\tfi\n+done\n+\n+exit 0\n", "prefixes": [ "libcamera-devel" ] }