[libcamera-devel] [PATCH] utils: hooks: pre-push: Reject commits with a Change-Id
Kieran Bingham
kieran.bingham at ideasonboard.com
Fri Oct 30 14:27:41 CET 2020
Hi Laurent,
On 30/10/2020 13:03, Laurent Pinchart wrote:
> Hi Kieran,
>
> On Fri, Oct 30, 2020 at 09:29:01AM +0000, Kieran Bingham wrote:
>> 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?
>
> git log will answer that question :-) It has happened once, in
> b2b8c4dc941b979ddf5e9013530e76c67e6a12fe.
>
>> 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?
>>
See I knew it would be me ;-)
--
Kieran
>>> 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