mirror of
https://github.com/apache/nuttx.git
synced 2026-02-06 12:42:21 +08:00
tools/checkpatch.sh: check format for all commits in patch
If more than one commit is present in the patch, the commit format must be checked separately for each commit in patch, otherwise not all errors are detected. Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
@@ -334,15 +334,23 @@ check_msg() {
|
||||
fi
|
||||
|
||||
if (( $num_lines < $min_num_lines && $signedoffby_found == 1 )); then
|
||||
echo "Missing git commit message."
|
||||
fail=1
|
||||
echo "Missing git commit message"
|
||||
fail=1
|
||||
fi
|
||||
}
|
||||
|
||||
check_commit() {
|
||||
if [ $message != 0 ]; then
|
||||
msg=`git show -s --format=%B $1`
|
||||
check_msg <<< "$msg"
|
||||
# check each commit format separately if this is a series of commits
|
||||
if [[ $1 =~ HEAD ]]; then
|
||||
for commit in $(git rev-list --no-merges $1); do
|
||||
msg=`git show -s --format=%B $commit`
|
||||
check_msg <<< "$msg"
|
||||
done
|
||||
else
|
||||
msg=`git show -s --format=%B $1`
|
||||
check_msg <<< "$msg"
|
||||
fi
|
||||
fi
|
||||
diffs=`git diff $1`
|
||||
check_ranges <<< "$diffs"
|
||||
|
||||
Reference in New Issue
Block a user