checkpatch: adapt shell script to the tool's new version
authorAntonio Borneo <borneo.antonio@gmail.com>
Wed, 27 Jan 2021 18:00:38 +0000 (19:00 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 18 Sep 2022 08:20:08 +0000 (08:20 +0000)
With the new checkpatch it's not possible to send in one shot a
set of patches through stdin because the Signed-off-by tag present
in each patch will trigger the error of duplicated Signed-off-by.

Use the new command-line flag '--git' to let checkpatch to extract
the patches from git and analyse them one-by-one.

While there, add the SPDX tag to the script.

Change-Id: I74791b627b8cd68f2d49146d15ae35bbc610e64e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6166
Tested-by: jenkins
tools/checkpatch.sh

index 0a630a248355e7d3453fb4c6e2f6828179d108d0..7375fc2b6d00bf3147fa734e208ce91d0fb1380a 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
 
 since=${1:-HEAD^}
-git format-patch -M --stdout $since | tools/scripts/checkpatch.pl -
+tools/scripts/checkpatch.pl --git ${since}..