Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/605009/?format=api
{ "id": 605009, "url": "http://patchwork.ozlabs.org/api/patches/605009/?format=api", "web_url": "http://patchwork.ozlabs.org/project/buildroot/patch/46bd01446c4d29cc9420380986b1a498a8606375.1459541702.git.yann.morin.1998@free.fr/", "project": { "id": 27, "url": "http://patchwork.ozlabs.org/api/projects/27/?format=api", "name": "Buildroot development", "link_name": "buildroot", "list_id": "buildroot.buildroot.org", "list_email": "buildroot@buildroot.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<46bd01446c4d29cc9420380986b1a498a8606375.1459541702.git.yann.morin.1998@free.fr>", "list_archive_url": null, "date": "2016-04-01T20:25:28", "name": "[1/4,v2] support/download/git: do not use bare clones", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "4752e096195ec2889465a9a7994c8759ead7e7c9", "submitter": { "id": 13903, "url": "http://patchwork.ozlabs.org/api/people/13903/?format=api", "name": "Yann E. MORIN", "email": "yann.morin.1998@free.fr" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/buildroot/patch/46bd01446c4d29cc9420380986b1a498a8606375.1459541702.git.yann.morin.1998@free.fr/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/605009/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/605009/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<buildroot-bounces@busybox.net>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "buildroot@lists.busybox.net" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "buildroot@osuosl.org" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ozlabs.org (Postfix) with ESMTP id 3qcCYw2Vmqz9sdm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 2 Apr 2016 07:25:40 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 9D775A638C;\n\tFri, 1 Apr 2016 20:25:39 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id K-kC91uB0ZT1; Fri, 1 Apr 2016 20:25:37 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 27C6DA6375;\n\tFri, 1 Apr 2016 20:25:37 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2AF511C0B41\n\tfor <buildroot@lists.busybox.net>;\n\tFri, 1 Apr 2016 20:25:36 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 271C095947\n\tfor <buildroot@lists.busybox.net>;\n\tFri, 1 Apr 2016 20:25:36 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EACAzJDo3cIy for <buildroot@lists.busybox.net>;\n\tFri, 1 Apr 2016 20:25:35 +0000 (UTC)", "from mail-wm0-f68.google.com (mail-wm0-f68.google.com\n\t[74.125.82.68])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 1F50C9593F\n\tfor <buildroot@buildroot.org>; Fri, 1 Apr 2016 20:25:35 +0000 (UTC)", "by mail-wm0-f68.google.com with SMTP id i204so965647wmd.0\n\tfor <buildroot@buildroot.org>; Fri, 01 Apr 2016 13:25:35 -0700 (PDT)", "from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66])\n\tby smtp.gmail.com with ESMTPSA id\n\tw203sm559814wmg.14.2016.04.01.13.25.32\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 01 Apr 2016 13:25:32 -0700 (PDT)" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com header.b=ivSHVizp;\n\tdkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=/1V3Klwbuq5ubjAM5C4kSEPC87jxhvE5UvMqgRTNXYY=;\n\tb=ivSHVizpwpUoVaJAWl1bFufxLwTvdo7c5kfnkK9prK7XLsQBZkbALcByL4CEXx9kDo\n\tk7sgurpGADRu+X7Tr9z/k66yTJmU18Xb5rxa995pAvl5LC8RodPXqmXc12jqhHpUnRfT\n\trYZpiIpIXMb2+nOQILbKUpHc6GI23U3hTBqIHLNpki+R1TRFV4h6Ipxlm/SkeGqDByE1\n\tkz8StyIL0hPZoGo1BgETye/WgPc5GcIr4lcdWN9muwRUNKqouvhpsdRKeIbrEiBQhjBk\n\tmVUh67RA0eikPRvKwfENmGKeqQteG9o5kncvKscuSp6UDxNwYlxYEAZiDKSII1NzIq5g\n\truKA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=/1V3Klwbuq5ubjAM5C4kSEPC87jxhvE5UvMqgRTNXYY=;\n\tb=dzHtNv/XVP7edSl1BZKTLVqZAq/krSZuKZaOZk8zUUFojJ4mtqgbakgJN2rz2iP7B+\n\tN+r82ktubbqnSO5oabY+HHSzEPwHnUbFS2pTqvLvrS5gc5sW5L50wq0NMNvZMqMakejL\n\t8sA0zYtb5pHdYfbO/lbqYvo2kcZTWPLeRq58pOkhT+WKLzXXh7zbSyuxA6AcroPDz5Yk\n\todsebDmTRqyrGzAx7Njk+1asJFwdomYhTyQXiIkqy1JNbn0EqFKmFViE2NgeXZmlEBwA\n\tLBDU9/Ln+1oHvB6ECi8GSMCfRwB/FdvkPw9IZ4FMLYf9VEzwTgdrrkhU0JnKNchZuCtN\n\tVh8g==", "X-Gm-Message-State": "AD7BkJLbNHO34ELZXGe4gnF9UpsiiG3TW50eWLmUgcyLGU6czhJz80mcM+srDPZQdBsAZg==", "X-Received": "by 10.28.4.195 with SMTP id 186mr498914wme.45.1459542333760;\n\tFri, 01 Apr 2016 13:25:33 -0700 (PDT)", "From": "\"Yann E. MORIN\" <yann.morin.1998@free.fr>", "To": "buildroot@buildroot.org", "Date": "Fri, 1 Apr 2016 22:25:28 +0200", "Message-Id": "<46bd01446c4d29cc9420380986b1a498a8606375.1459541702.git.yann.morin.1998@free.fr>", "X-Mailer": "git-send-email 1.9.1", "In-Reply-To": "<cover.1459541702.git.yann.morin.1998@free.fr>", "References": "<cover.1459541702.git.yann.morin.1998@free.fr>", "Cc": "\"Yann E. MORIN\" <yann.morin.1998@free.fr>", "Subject": "[Buildroot] [PATCH 1/4 v2] support/download/git: do not use bare\n\tclones", "X-BeenThere": "buildroot@busybox.net", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Discussion and development of buildroot <buildroot.busybox.net>", "List-Unsubscribe": "<http://lists.busybox.net/mailman/options/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=unsubscribe>", "List-Archive": "<http://lists.busybox.net/pipermail/buildroot/>", "List-Post": "<mailto:buildroot@busybox.net>", "List-Help": "<mailto:buildroot-request@busybox.net?subject=help>", "List-Subscribe": "<http://lists.busybox.net/mailman/listinfo/buildroot>,\n\t<mailto:buildroot-request@busybox.net?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "buildroot-bounces@busybox.net", "Sender": "\"buildroot\" <buildroot-bounces@busybox.net>" }, "content": "Currently, we are using bare clones, so as to minimise the disk usage,\nmost notably for largeish repositories such as the one for the Linux\nkernel, which can go beyond the 1GiB barrier.\n\nHowever, this precludes updating (and thus using) the submodules, if\nany, of the repositories, as a working copy is required to use\nsubmodules (becaue we need to know the list of submodules, where to find\nthem, where to clone them, what cset to checkout, and all those is\ndependent upon the checked out cset of the father repository).\n\nSwitch to using /plain/ clones with a working copy.\n\nThis means that the extra refs used by some forges (like pull-requests\nfor Github, or changes for gerrit...) are no longer fetched as part of\nthe clone, because git does not offer to do a mirror clone when there is\na working copy.\n\nInstead, we have to fetch those special refs by hand. Since there is no\neasy solution to know whether the cset the user asked for is such a\nspecial ref or not, we just try to always fetch the cset requested by\nthe user; if this fails, we assume that this is not a special ref (most\nprobably, it is a sha1) and we defer the check to the archive creation,\nwhich would fail if the requested cset is missing anyway.\n\nSigned-off-by: \"Yann E. MORIN\" <yann.morin.1998@free.fr>\n---\n support/download/git | 21 ++++++++++++++++++---\n 1 file changed, 18 insertions(+), 3 deletions(-)", "diff": "diff --git a/support/download/git b/support/download/git\nindex 314b388..20b436e 100755\n--- a/support/download/git\n+++ b/support/download/git\n@@ -41,7 +41,7 @@ _git() {\n git_done=0\n if [ -n \"$(_git ls-remote \"'${repo}'\" \"'${cset}'\" 2>&1)\" ]; then\n printf \"Doing shallow clone\\n\"\n- if _git clone ${verbose} --depth 1 -b \"'${cset}'\" --bare \"'${repo}'\" \"'${basename}'\"; then\n+ if _git clone ${verbose} --depth 1 -b \"'${cset}'\" \"'${repo}'\" \"'${basename}'\"; then\n git_done=1\n else\n printf \"Shallow clone failed, falling back to doing a full clone\\n\"\n@@ -49,10 +49,25 @@ if [ -n \"$(_git ls-remote \"'${repo}'\" \"'${cset}'\" 2>&1)\" ]; then\n fi\n if [ ${git_done} -eq 0 ]; then\n printf \"Doing full clone\\n\"\n- _git clone ${verbose} --mirror \"'${repo}'\" \"'${basename}'\"\n+ _git clone ${verbose} \"'${repo}'\" \"'${basename}'\"\n+fi\n+\n+pushd \"${basename}\" >/dev/null\n+\n+# Try to get the special refs exposed by some forges (pull-requests for\n+# github, changes for gerrit...). There is no easy way to know whether\n+# the cset the user passed us is such a special ref or a tag or a sha1\n+# or whatever else. We'll eventually fail at checking out that cset,\n+# below, if there is an issue anyway. Since most of the cset we're gonna\n+# have to clone are not such special refs, consign the output to oblivion\n+# so as not to alarm unsuspecting users, but still trace it as a warning.\n+if ! _git fetch \"'${cset}:${cset}'\" >/dev/null 2>&1; then\n+ printf \"Could not fetch special ref '%s'; assuming it is not special.\\n\" \"${cset}\"\n fi\n \n-GIT_DIR=\"${basename}\" \\\n _git archive --prefix=\"'${basename}/'\" -o \"'${output}.tmp'\" --format=tar \"'${cset}'\"\n \n+# Not really required, but here for consistency\n+popd >/dev/null\n+\n gzip -n <\"${output}.tmp\" >\"${output}\"\n", "prefixes": [ "1/4", "v2" ] }