[{"id":506,"web_url":"https://patchwork.libcamera.org/comment/506/","msgid":"<20190122233203.GP3264@pendragon.ideasonboard.com>","date":"2019-01-22T23:32:03","subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Tue, Jan 22, 2019 at 07:29:30PM +0000, Kieran Bingham wrote:\n> Provide an example post-commit hook which a developer can install, ensuring\n> that every commit gets the style checker executed on it.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  utils/hooks/post-commit | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>  create mode 100755 utils/hooks/post-commit\n> \n> diff --git a/utils/hooks/post-commit b/utils/hooks/post-commit\n> new file mode 100755\n> index 000000000000..e992428b11ae\n> --- /dev/null\n> +++ b/utils/hooks/post-commit\n> @@ -0,0 +1,11 @@\n> +#!/bin/sh\n> +\n> +# Execute the checkstyle script after committing any code.  This allows the\n\ns/  / / or is it on purpose ?\n\n> +# commit to succeed, but ensures that the developer is aware of any potential\n> +# issues immediately, and can resolve them and fix rapidly with:\n> +#   git commit --amend\n> +#\n> +# To utilise this hook, install this file to:\n> +#   .git/hooks/post-commit\n\nI would say\n\n# To utilise this hook, install this file to:\n#   cp utils/hooks/post-commit .git/hooks/post-commit\n\n> +\n> +./utils/checkstyle.py\n\nAre hooks always run from the root of the tree if you run git commit\nfrom a subdirectory ? If not, I'm sure there's a way for the hook to the\nthe base path.\n\nWith these issues addressed,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>","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 E020560C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 00:32:04 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 61F93575;\n\tWed, 23 Jan 2019 00:32:04 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548199924;\n\tbh=pJvkiojLAPF4A3mz4de0gpzRXOO+pB8a1YVSq0Wq+Q8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JqCwhein6fM3/54czWiZRmHnu/k6L3M0954Aag22cfyJCshzZbazsdCbxcF3UgWJL\n\tPKkt4D+eWag6iEzSLP3qcQpbvh1lR0QxMlsKGbisEeQtcT4JrUr4eTjr5cE9UL2vcq\n\tMI5ob0xOWxtm8kzlWW7s2NKOynCOi0skSuW8w9qE=","Date":"Wed, 23 Jan 2019 01:32:03 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190122233203.GP3264@pendragon.ideasonboard.com>","References":"<20190122192930.10540-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190122192930.10540-1-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Tue, 22 Jan 2019 23:32:05 -0000"}},{"id":529,"web_url":"https://patchwork.libcamera.org/comment/529/","msgid":"<25332edc-39f9-2968-37e4-b606985a15c1@ideasonboard.com>","date":"2019-01-23T14:15:47","subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 22/01/2019 23:32, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Tue, Jan 22, 2019 at 07:29:30PM +0000, Kieran Bingham wrote:\n>> Provide an example post-commit hook which a developer can install, ensuring\n>> that every commit gets the style checker executed on it.\n>>\n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> ---\n>>  utils/hooks/post-commit | 11 +++++++++++\n>>  1 file changed, 11 insertions(+)\n>>  create mode 100755 utils/hooks/post-commit\n>>\n>> diff --git a/utils/hooks/post-commit b/utils/hooks/post-commit\n>> new file mode 100755\n>> index 000000000000..e992428b11ae\n>> --- /dev/null\n>> +++ b/utils/hooks/post-commit\n>> @@ -0,0 +1,11 @@\n>> +#!/bin/sh\n>> +\n>> +# Execute the checkstyle script after committing any code.  This allows the\n> \n> s/  / / or is it on purpose ?\n\nThat was done by vim's auto-formatter. <esc-gqip>\n\n> \n>> +# commit to succeed, but ensures that the developer is aware of any potential\n>> +# issues immediately, and can resolve them and fix rapidly with:\n>> +#   git commit --amend\n>> +#\n>> +# To utilise this hook, install this file to:\n>> +#   .git/hooks/post-commit\n> \n> I would say\n> \n> # To utilise this hook, install this file to:\n> #   cp utils/hooks/post-commit .git/hooks/post-commit\n\nwhat about 'ln -s' to keep updates?\n\n'install this file to:' then doesn't flow... so perhaps it would have to\nread\n\n'install this file with:' or 'by':\n\nBut the point was - I was leaving this operation up to the user.\n\n\n>> +\n>> +./utils/checkstyle.py\n> \n> Are hooks always run from the root of the tree if you run git commit\n> from a subdirectory ? If not, I'm sure there's a way for the hook to the\n> the base path.\n\nThe hook is executed from the root of the tree.\n\nYou can test by going into any sub-directory and creating a commit.\nThe hook will still successfully run.\n\n> \n> With these issues addressed,\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>","headers":{"Return-Path":"<kieran.bingham@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 8496460C7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 15:15:52 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A0CC123D;\n\tWed, 23 Jan 2019 15:15:51 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548252951;\n\tbh=Hbu5rXAytaYvGQMq1vz677ap8kToe15oGxyy/L2nifQ=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=oCr0r6DVYhA8NpIR8bEz1aGlC+gDBhNJYgoO+Odefd1Yhdv04i2vzAqnwrgqJePY/\n\tkm1rnbKs1uaZNaBeQuR26ln7DLn2vMvLkl7ksBilDV4zscDAHOQ/wkWv5G7xo+4nmr\n\tWeHsmTAMhiIfFOAIV4uyI1qadYtMnF9XgvkpqUN0=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","References":"<20190122192930.10540-1-kieran.bingham@ideasonboard.com>\n\t<20190122233203.GP3264@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36\n\tOe9X9dXB8YSNt7VjOcO7BTmFn/Z8r92mSAfHXpb07YJWJosQOQARAQABtDBLaWVyYW4gQmlu\n\tZ2hhbSA8a2llcmFuLmJpbmdoYW1AaWRlYXNvbmJvYXJkLmNvbT6JAkAEEwEKACoCGwMFCwkI\n\tBwIGFQgJCgsCBBYCAwECHgECF4ACGQEFAlnDk/gFCQeA/YsACgkQoR5GchCkYf3X5w/9EaZ7\n\tcnUcT6dxj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tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<25332edc-39f9-2968-37e4-b606985a15c1@ideasonboard.com>","Date":"Wed, 23 Jan 2019 14:15:47 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.2.1","MIME-Version":"1.0","In-Reply-To":"<20190122233203.GP3264@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Wed, 23 Jan 2019 14:15:52 -0000"}},{"id":543,"web_url":"https://patchwork.libcamera.org/comment/543/","msgid":"<20190123161653.GF31885@pendragon.ideasonboard.com>","date":"2019-01-23T16:16:53","subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Wed, Jan 23, 2019 at 02:15:47PM +0000, Kieran Bingham wrote:\n> On 22/01/2019 23:32, Laurent Pinchart wrote:\n> > On Tue, Jan 22, 2019 at 07:29:30PM +0000, Kieran Bingham wrote:\n> >> Provide an example post-commit hook which a developer can install, ensuring\n> >> that every commit gets the style checker executed on it.\n> >>\n> >> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >> ---\n> >>  utils/hooks/post-commit | 11 +++++++++++\n> >>  1 file changed, 11 insertions(+)\n> >>  create mode 100755 utils/hooks/post-commit\n> >>\n> >> diff --git a/utils/hooks/post-commit b/utils/hooks/post-commit\n> >> new file mode 100755\n> >> index 000000000000..e992428b11ae\n> >> --- /dev/null\n> >> +++ b/utils/hooks/post-commit\n> >> @@ -0,0 +1,11 @@\n> >> +#!/bin/sh\n> >> +\n> >> +# Execute the checkstyle script after committing any code.  This allows the\n> > \n> > s/  / / or is it on purpose ?\n> \n> That was done by vim's auto-formatter. <esc-gqip>\n\nInteresting, vim doesn't modify the amount of spaces for me when doing\nreformatting.\n\n> >> +# commit to succeed, but ensures that the developer is aware of any potential\n> >> +# issues immediately, and can resolve them and fix rapidly with:\n> >> +#   git commit --amend\n> >> +#\n> >> +# To utilise this hook, install this file to:\n> >> +#   .git/hooks/post-commit\n> > \n> > I would say\n> > \n> > # To utilise this hook, install this file to:\n> > #   cp utils/hooks/post-commit .git/hooks/post-commit\n> \n> what about 'ln -s' to keep updates?\n\nYou would need to put lots of trust on the repository for that... I\nwouldn't do it personally, imagine if someone pushed a rm -rf $HOME to\nthe script.\n\n> 'install this file to:' then doesn't flow... so perhaps it would have to\n> read\n> \n> 'install this file with:' or 'by':\n\nGood point, with and by both work for me.\n\n> But the point was - I was leaving this operation up to the user.\n> \n> >> +\n> >> +./utils/checkstyle.py\n> > \n> > Are hooks always run from the root of the tree if you run git commit\n> > from a subdirectory ? If not, I'm sure there's a way for the hook to the\n> > the base path.\n> \n> The hook is executed from the root of the tree.\n> \n> You can test by going into any sub-directory and creating a commit.\n> The hook will still successfully run.\n\nOK, perfect then.\n\n> > With these issues addressed,\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 08D4D60B2D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 17:16:55 +0100 (CET)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6C24623D;\n\tWed, 23 Jan 2019 17:16:54 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548260214;\n\tbh=jYumnOIywBFn+lhcmNfomlscaMwOO4DdJIbHS9S13KQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=bfKtgKSsqDPRyDFBQuEg9d0nzAEJcGGMOJ6rWYdIXdKyn8WPfeUsRnwV9vjgOqfrj\n\tzlOMMGE8jejQ266Q07J3w6yWlkbl+UlW/Br0uDUI+E1XyYHlMagp4EisQsYHfrzi1n\n\thRkagc0CNEJKNfRjArlkJFOY3gg6c8PdWgoPwjuI=","Date":"Wed, 23 Jan 2019 18:16:53 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190123161653.GF31885@pendragon.ideasonboard.com>","References":"<20190122192930.10540-1-kieran.bingham@ideasonboard.com>\n\t<20190122233203.GP3264@pendragon.ideasonboard.com>\n\t<25332edc-39f9-2968-37e4-b606985a15c1@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<25332edc-39f9-2968-37e4-b606985a15c1@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Wed, 23 Jan 2019 16:16:55 -0000"}},{"id":696,"web_url":"https://patchwork.libcamera.org/comment/696/","msgid":"<e8ef9fb8-02b8-0470-30b6-d6941f8c28fe@ideasonboard.com>","date":"2019-01-30T10:59:25","subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 23/01/2019 16:16, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> On Wed, Jan 23, 2019 at 02:15:47PM +0000, Kieran Bingham wrote:\n>> On 22/01/2019 23:32, Laurent Pinchart wrote:\n>>> On Tue, Jan 22, 2019 at 07:29:30PM +0000, Kieran Bingham wrote:\n>>>> Provide an example post-commit hook which a developer can install, ensuring\n>>>> that every commit gets the style checker executed on it.\n>>>>\n>>>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>>>> ---\n>>>>  utils/hooks/post-commit | 11 +++++++++++\n>>>>  1 file changed, 11 insertions(+)\n>>>>  create mode 100755 utils/hooks/post-commit\n>>>>\n>>>> diff --git a/utils/hooks/post-commit b/utils/hooks/post-commit\n>>>> new file mode 100755\n>>>> index 000000000000..e992428b11ae\n>>>> --- /dev/null\n>>>> +++ b/utils/hooks/post-commit\n>>>> @@ -0,0 +1,11 @@\n>>>> +#!/bin/sh\n>>>> +\n>>>> +# Execute the checkstyle script after committing any code.  This allows the\n>>>\n>>> s/  / / or is it on purpose ?\n>>\n>> That was done by vim's auto-formatter. <esc-gqip>\n> \n> Interesting, vim doesn't modify the amount of spaces for me when doing\n> reformatting.\n> \n>>>> +# commit to succeed, but ensures that the developer is aware of any potential\n>>>> +# issues immediately, and can resolve them and fix rapidly with:\n>>>> +#   git commit --amend\n>>>> +#\n>>>> +# To utilise this hook, install this file to:\n>>>> +#   .git/hooks/post-commit\n>>>\n>>> I would say\n>>>\n>>> # To utilise this hook, install this file to:\n>>> #   cp utils/hooks/post-commit .git/hooks/post-commit\n>>\n>> what about 'ln -s' to keep updates?\n> \n> You would need to put lots of trust on the repository for that... I\n> wouldn't do it personally, imagine if someone pushed a rm -rf $HOME to\n> the script.\n> \n>> 'install this file to:' then doesn't flow... so perhaps it would have to\n>> read\n>>\n>> 'install this file with:' or 'by':\n> \n> Good point, with and by both work for me.\n> \n>> But the point was - I was leaving this operation up to the user.\n>>\n>>>> +\n>>>> +./utils/checkstyle.py\n>>>\n>>> Are hooks always run from the root of the tree if you run git commit\n>>> from a subdirectory ? If not, I'm sure there's a way for the hook to the\n>>> the base path.\n>>\n>> The hook is executed from the root of the tree.\n>>\n>> You can test by going into any sub-directory and creating a commit.\n>> The hook will still successfully run.\n> \n> OK, perfect then.\n> \n>>> With these issues addressed,\n>>>\n>>> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nPushed with the fixes suggested.","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E7FD860DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jan 2019 11:59:28 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4CE4741;\n\tWed, 30 Jan 2019 11:59:28 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548845968;\n\tbh=EAcUrCForZlUygCyGGj9n2gTsiU1o7AewPQqBCTiNMQ=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=QRbZm0EroBFE25/IndBXBF6Tki2LnfQDbNUINv7hsHddNnwBSZzwMyeGnKzl7v4py\n\tuZmtakzLHH7v22v5QtE9jsq4I+NtPiaW9ME2k3LZdaJBJbxJR8P1yf6ZDG9JVtbR9s\n\thdiM9Uh0Hyn4HD7x9yVO7ouweLokOrBlO5opPFbk=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","References":"<20190122192930.10540-1-kieran.bingham@ideasonboard.com>\n\t<20190122233203.GP3264@pendragon.ideasonboard.com>\n\t<25332edc-39f9-2968-37e4-b606985a15c1@ideasonboard.com>\n\t<20190123161653.GF31885@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC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7WCIECWYem6pLwaw6IAL7oX+tEqIMPph/G/jwZcdS6Hkyt/esHPuHNwX4guqTbVEuRqbDzDI\n\t2DJO5FbxABEBAAGJAiUEGAEKAA8CGwwFAlnDlGsFCQeA/gIACgkQoR5GchCkYf1yYRAAq+Yo\n\tnbf9DGdK1kTAm2RTFg+w9oOp2Xjqfhds2PAhFFvrHQg1XfQR/UF/SjeUmaOmLSczM0s6XMeO\n\tVcE77UFtJ/+hLo4PRFKm5X1Pcar6g5m4xGqa+Xfzi9tRkwC29KMCoQOag1BhHChgqYaUH3yo\n\tUzaPwT/fY75iVI+yD0ih/e6j8qYvP8pvGwMQfrmN9YB0zB39YzCSdaUaNrWGD3iCBxg6lwSO\n\tLKeRhxxfiXCIYEf3vwOsP3YMx2JkD5doseXmWBGW1U0T/oJF+DVfKB6mv5UfsTzpVhJRgee7\n\t4jkjqFq4qsUGxcvF2xtRkfHFpZDbRgRlVmiWkqDkT4qMA+4q1y/dWwshSKi/uwVZNycuLsz+\n\t+OD8xPNCsMTqeUkAKfbD8xW4LCay3r/dD2ckoxRxtMD9eOAyu5wYzo/ydIPTh1QEj9SYyvp8\n\tO0g6CpxEwyHUQtF5oh15O018z3ZLztFJKR3RD42VKVsrnNDKnoY0f4U0z7eJv2NeF8xHMuiU\n\tRCIzqxX1GVYaNkKTnb/Qja8hnYnkUzY1Lc+OtwiGmXTwYsPZjjAaDX35J/RSKAoy5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<e8ef9fb8-02b8-0470-30b6-d6941f8c28fe@ideasonboard.com>","Date":"Wed, 30 Jan 2019 10:59:25 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.4.0","MIME-Version":"1.0","In-Reply-To":"<20190123161653.GF31885@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH] utils: hooks: Provide post-commit\n\thook example to checkstyle.py","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Wed, 30 Jan 2019 10:59:29 -0000"}}]