[libcamera-devel] [PATCH] utils: hooks: pre-push: Reject commits with a Change-Id

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Oct 30 10:29:01 CET 2020


Hi Laurent,

On 30/10/2020 01:37, Laurent Pinchart wrote:
> We're not using gerrit, so let's prevent Change-Id tags creeping in
> unadvertently.
> 

s/unadvertently/inadvertently/

Has this happened?

It /almost/ happened to me, as I committed some code while working in
the repository checked out in CrOS, which installs the gerrit hooks.

I saw it and removed it, so to see this pop up 2 days later makes me
doubt myself - yet I can't see any Change-Id tags in our tree?

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


Anyway, - certainly - these can be caught and stripped out.

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> ---
>  utils/hooks/pre-push | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/utils/hooks/pre-push b/utils/hooks/pre-push
> index 2417d379db4c..d13e2c3b506c 100755
> --- a/utils/hooks/pre-push
> +++ b/utils/hooks/pre-push
> @@ -63,6 +63,13 @@ do
>  			echo >&2 "No Reviewed-by or Acked-by in commit $commit"
>  			errors=$((errors+1))
>  		fi
> +
> +		# 4. The commit message shall not contain a Change-Id.
> +		if echo "$msg" | grep -q '^Change-Id:'
> +		then
> +			echo >&2 "Found Change-Id in commit $commit"
> +			errors=$((errors+1))
> +		fi
>  	done
>  
>  	if [ $errors != 0 ]
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list