[{"id":3491,"web_url":"https://patchwork.libcamera.org/comment/3491/","msgid":"<20200117222035.GA5299@pendragon.ideasonboard.com>","date":"2020-01-17T22:20:35","subject":"Re: [libcamera-devel] [PATCH v2 6/6] checkstyle: Add a pre-commit\n\thook script","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Nicolas,\n\nThank you for the patch.\n\nOn Fri, Jan 17, 2020 at 02:17:33PM -0500, Nicolas Dufresne wrote:\n> From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \n> This adds support for pre-commit hook workflow. In pre-commit hook we\n> check the style on the changes currently staged or the combination\n> of the index and the last commit if \"git commit --amend\" is being used.\n> \n> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> ---\n>  utils/hooks/pre-commit | 17 +++++++++++++++++\n>  1 file changed, 17 insertions(+)\n>  create mode 100755 utils/hooks/pre-commit\n> \n> diff --git a/utils/hooks/pre-commit b/utils/hooks/pre-commit\n> new file mode 100755\n> index 0000000..be2f8b3\n> --- /dev/null\n> +++ b/utils/hooks/pre-commit\n> @@ -0,0 +1,17 @@\n> +#!/bin/sh\n> +\n> +# Execute the checkstyle script after committing any code. This allows the\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 with:\n> +#   cp utils/hooks/post-commit .git/hooks/post-commit\n> +\n> +args=\"--staged\"\n> +if ps -ocommand= -p $PPID | grep -- \"--amend\"\n> +then\n> +   commit=\"--amend\"\n\ncommit isn't used below... Did you mean args ? Seems more testing is\nneeded ;-)\n\n> +fi\n> +\n> +./utils/checkstyle.py $args","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 1DF2160782\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 23:20:51 +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 842D49A1;\n\tFri, 17 Jan 2020 23:20:50 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1579299650;\n\tbh=i9ecus6GpDoHMI1EUP4e4/1L+EbFX+N3U8UM8kxkAww=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Q9Kg9N9pY0OZd5YebTRoHnVaV0fqFEwLpGLyawntRVF4iFG68PDljE4zud9AYTPMD\n\tssfwC/TsSHeOCFRV+bU6ADVfponyLRr3HjTx+6fZAqT4ngXKV+qiFhqqWQ0q86Wevo\n\tFoaP+Q8evKj0ByxA7ZkGdol63gf3dwLkPb4XLGq8=","Date":"Sat, 18 Jan 2020 00:20:35 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Nicolas Dufresne <nicolas@ndufresne.ca>","Cc":"libcamera-devel@lists.libcamera.org,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Message-ID":"<20200117222035.GA5299@pendragon.ideasonboard.com>","References":"<20200117191733.198897-1-nicolas@ndufresne.ca>\n\t<20200117191733.198897-7-nicolas@ndufresne.ca>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200117191733.198897-7-nicolas@ndufresne.ca>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2 6/6] checkstyle: Add a pre-commit\n\thook script","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":"Fri, 17 Jan 2020 22:20:51 -0000"}},{"id":3500,"web_url":"https://patchwork.libcamera.org/comment/3500/","msgid":"<5266680cb5d8b0230962409b08ea34b83b879008.camel@collabora.com>","date":"2020-01-17T22:59:13","subject":"Re: [libcamera-devel] [PATCH v2 6/6] checkstyle: Add a pre-commit\n\thook script","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le samedi 18 janvier 2020 à 00:20 +0200, Laurent Pinchart a écrit :\n> Hi Nicolas,\n> \n> Thank you for the patch.\n> \n> On Fri, Jan 17, 2020 at 02:17:33PM -0500, Nicolas Dufresne wrote:\n> > From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > \n> > This adds support for pre-commit hook workflow. In pre-commit hook we\n> > check the style on the changes currently staged or the combination\n> > of the index and the last commit if \"git commit --amend\" is being used.\n> > \n> > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > ---\n> >  utils/hooks/pre-commit | 17 +++++++++++++++++\n> >  1 file changed, 17 insertions(+)\n> >  create mode 100755 utils/hooks/pre-commit\n> > \n> > diff --git a/utils/hooks/pre-commit b/utils/hooks/pre-commit\n> > new file mode 100755\n> > index 0000000..be2f8b3\n> > --- /dev/null\n> > +++ b/utils/hooks/pre-commit\n> > @@ -0,0 +1,17 @@\n> > +#!/bin/sh\n> > +\n> > +# Execute the checkstyle script after committing any code. This allows the\n> > +# commit to succeed, but ensures that the developer is aware of any\n> > 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 with:\n> > +#   cp utils/hooks/post-commit .git/hooks/post-commit\n> > +\n> > +args=\"--staged\"\n> > +if ps -ocommand= -p $PPID | grep -- \"--amend\"\n> > +then\n> > +   commit=\"--amend\"\n> \n> commit isn't used below... Did you mean args ? Seems more testing is\n> needed ;-)\n\nThat one I didn't have locally, fixing.\n\n> \n> > +fi\n> > +\n> > +./utils/checkstyle.py $args","headers":{"Return-Path":"<nicolas.dufresne@collabora.com>","Received":["from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3016660792\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 17 Jan 2020 23:59:23 +0100 (CET)","from nicolas-tpx395.localdomain (unknown [IPv6:2610:98:8005::127])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 61DEC29487B;\n\tFri, 17 Jan 2020 22:59:22 +0000 (GMT)"],"Message-ID":"<5266680cb5d8b0230962409b08ea34b83b879008.camel@collabora.com>","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Date":"Fri, 17 Jan 2020 17:59:13 -0500","In-Reply-To":"<20200117222035.GA5299@pendragon.ideasonboard.com>","References":"<20200117191733.198897-1-nicolas@ndufresne.ca>\n\t<20200117191733.198897-7-nicolas@ndufresne.ca>\n\t<20200117222035.GA5299@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","User-Agent":"Evolution 3.34.3 (3.34.3-1.fc31) ","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2 6/6] checkstyle: Add a pre-commit\n\thook script","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":"Fri, 17 Jan 2020 22:59:23 -0000"}}]