[libcamera-devel] [PATCH] utils: hooks: Provide post-commit hook example to checkstyle.py

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jan 23 00:32:03 CET 2019


Hi Kieran,

Thank you for the patch.

On Tue, Jan 22, 2019 at 07:29:30PM +0000, Kieran Bingham wrote:
> Provide an example post-commit hook which a developer can install, ensuring
> that every commit gets the style checker executed on it.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  utils/hooks/post-commit | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>  create mode 100755 utils/hooks/post-commit
> 
> diff --git a/utils/hooks/post-commit b/utils/hooks/post-commit
> new file mode 100755
> index 000000000000..e992428b11ae
> --- /dev/null
> +++ b/utils/hooks/post-commit
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +# Execute the checkstyle script after committing any code.  This allows the

s/  / / or is it on purpose ?

> +# commit to succeed, but ensures that the developer is aware of any potential
> +# issues immediately, and can resolve them and fix rapidly with:
> +#   git commit --amend
> +#
> +# To utilise this hook, install this file to:
> +#   .git/hooks/post-commit

I would say

# To utilise this hook, install this file to:
#   cp utils/hooks/post-commit .git/hooks/post-commit

> +
> +./utils/checkstyle.py

Are hooks always run from the root of the tree if you run git commit
from a subdirectory ? If not, I'm sure there's a way for the hook to the
the base path.

With these issues addressed,

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list