summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2019-05-10 09:49:36 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-05-10 15:16:23 +0200
commitee2b25c85a027af658ff50f33d737716d6350b90 (patch)
tree2a384126a53bcb9064bf635cd2c844f2aab87cf4
parent93fa422f742ad9c4679a25d4b0e875856fd6a393 (diff)
downloaddpdk-ee2b25c85a027af658ff50f33d737716d6350b90.zip
dpdk-ee2b25c85a027af658ff50f33d737716d6350b90.tar.gz
dpdk-ee2b25c85a027af658ff50f33d737716d6350b90.tar.xz
devtools: select patches to check with git range
Rather than default to origin/master.., it can be handy to choose the range you want to check. Example on a branch rebased on next-net: Before: $ ./devtools/checkpatches.sh ... ... 67/69 valid patches After: $ ./devtools/checkpatches.sh -r next-net/master.. 3/3 valid patches Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
-rwxr-xr-xdevtools/checkpatches.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 3272774..6a01b39 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -44,13 +44,14 @@ trap "clean_tmp_files" INT
print_usage () {
cat <<- END_OF_HELP
- usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]]
+ usage: $(basename $0) [-q] [-v] [-nX|-r range|patch1 [patch2] ...]]
Run Linux kernel checkpatch.pl with DPDK options.
The environment variable DPDK_CHECKPATCH_PATH must be set.
The patches to check can be from stdin, files specified on the command line,
- or latest git commits limited with -n option (default limit: origin/master).
+ latest git commits limited with -n option, or commits in the git range
+ specified with -r option (default: "origin/master..").
END_OF_HELP
}
@@ -79,12 +80,14 @@ check_forbidden_additions() { # <patch>
}
number=0
+range='origin/master..'
quiet=false
verbose=false
-while getopts hn:qv ARG ; do
+while getopts hn:qr:v ARG ; do
case $ARG in
n ) number=$OPTARG ;;
q ) quiet=true ;;
+ r ) range=$OPTARG ;;
v ) verbose=true ;;
h ) print_usage ; exit 0 ;;
? ) print_usage ; exit 1 ;;
@@ -172,7 +175,7 @@ elif [ ! -t 0 ] ; then # stdin
check '' '' "$subject"
else
if [ $number -eq 0 ] ; then
- commits=$(git rev-list --reverse origin/master..)
+ commits=$(git rev-list --reverse $range)
else
commits=$(git rev-list --reverse --max-count=$number HEAD)
fi