zephyr/scripts/series-push-hook.sh
Erwan Gouriou 48b786b159 scripts: series-push-hook: Fix behavior after rebase
Avoids parsing the whole "before to now" commits after rebase.
Now, we just parse all commits since first commit of the branch
compared to master, each timer either at first push, forced push,
forced push after rebase.

Fixes #28509

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-21 07:16:54 -05:00

32 lines
524 B
Bash
Executable file

#!/bin/sh
#
# Copyright (c) 2019 Linaro Limited
#
# SPDX-License-Identifier: Apache-2.0
#
remote=$1
url=$2
local_ref=$3
local_sha=$4
remote_ref=$5
remote_sha=$6
z40=0000000000000000000000000000000000000000
set -e exec
echo "Run push "
if [ "$local_sha" = $z40 ]
then
# Handle delete
:
else
# At each (forced) push, examine all commits since $remote/master
base_commit=`git rev-parse $remote/master`
range="$base_commit..$local_sha"
echo "Perform check patch"
${ZEPHYR_BASE}/scripts/checkpatch.pl --git $range
fi