From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 92F01A0096 for ; Fri, 10 May 2019 09:50:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B88934C6C; Fri, 10 May 2019 09:50:00 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id A497B49DF for ; Fri, 10 May 2019 09:49:58 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B76230917AD; Fri, 10 May 2019 07:49:57 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3471160C10; Fri, 10 May 2019 07:49:56 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com Date: Fri, 10 May 2019 09:49:36 +0200 Message-Id: <1557474576-16619-1-git-send-email-david.marchand@redhat.com> In-Reply-To: <1553260606-28325-1-git-send-email-david.marchand@redhat.com> References: <1553260606-28325-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 10 May 2019 07:49:57 +0000 (UTC) Subject: [dpdk-dev] [PATCH v2] devtools: select patches to check with git range X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190510074936.D16vSb8gmmkeZ5VFnNkD-N1g5sO_BIvcQFQz1KAr0PM@z> 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: [dmarchan@dmarchan dpdk]$ ./devtools/checkpatches.sh ... ... 67/69 valid patches After: [dmarchan@dmarchan dpdk]$ ./devtools/checkpatches.sh -r next-net/master.. 3/3 valid patches Signed-off-by: David Marchand Acked-by: Thomas Monjalon --- devtools/checkpatches.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- Changelog since v1: - fixed usage string to reflect the new option is exclusive to other options that select patches (tu clair, Thomas) 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() { # } 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 -- 1.8.3.1