* [dpdk-dev] [PATCH] devtools: select patches to check with git range
@ 2019-03-22 13:16 David Marchand
2019-03-22 13:16 ` David Marchand
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: David Marchand @ 2019-03-22 13:16 UTC (permalink / raw)
To: dev; +Cc: thomas, ferruh.yigit
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 <david.marchand@redhat.com>
---
devtools/checkpatches.sh | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 3272774..359d353 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|patch1 [patch2] ...]] [-r range]
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).
+ or latest git commits limited with -n option or commits in the 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
--
1.8.3.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH] devtools: select patches to check with git range
2019-03-22 13:16 [dpdk-dev] [PATCH] devtools: select patches to check with git range David Marchand
@ 2019-03-22 13:16 ` David Marchand
2019-05-09 21:54 ` Thomas Monjalon
2019-05-10 7:49 ` [dpdk-dev] [PATCH v2] " David Marchand
2 siblings, 0 replies; 10+ messages in thread
From: David Marchand @ 2019-03-22 13:16 UTC (permalink / raw)
To: dev; +Cc: thomas, ferruh.yigit
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 <david.marchand@redhat.com>
---
devtools/checkpatches.sh | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 3272774..359d353 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|patch1 [patch2] ...]] [-r range]
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).
+ or latest git commits limited with -n option or commits in the 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
--
1.8.3.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: select patches to check with git range
2019-03-22 13:16 [dpdk-dev] [PATCH] devtools: select patches to check with git range David Marchand
2019-03-22 13:16 ` David Marchand
@ 2019-05-09 21:54 ` Thomas Monjalon
2019-05-09 21:54 ` Thomas Monjalon
2019-05-09 22:05 ` Thomas Monjalon
2019-05-10 7:49 ` [dpdk-dev] [PATCH v2] " David Marchand
2 siblings, 2 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-09 21:54 UTC (permalink / raw)
To: David Marchand; +Cc: dev, ferruh.yigit
22/03/2019 14:16, David Marchand:
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> - usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]]
> + usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] [-r range]
The option -r should be before the filename arguments,
and inside the same brackets as -n as they are exclusive.
(je clair ne pas ;)
> 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).
> + or latest git commits limited with -n option or commits in the range
> + specified with -r option (default: origin/master..).
I suggest this reword:
The patches to check can be from stdin, files specified on the command line,
latest git commits limited with -n option, or commits in the git range
specified with -r option (default: "origin/master..").
[...]
> 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
Looks good and very useful, thanks :)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: select patches to check with git range
2019-05-09 21:54 ` Thomas Monjalon
@ 2019-05-09 21:54 ` Thomas Monjalon
2019-05-09 22:05 ` Thomas Monjalon
1 sibling, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-09 21:54 UTC (permalink / raw)
To: David Marchand; +Cc: dev, ferruh.yigit
22/03/2019 14:16, David Marchand:
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> - usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]]
> + usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] [-r range]
The option -r should be before the filename arguments,
and inside the same brackets as -n as they are exclusive.
(je clair ne pas ;)
> 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).
> + or latest git commits limited with -n option or commits in the range
> + specified with -r option (default: origin/master..).
I suggest this reword:
The patches to check can be from stdin, files specified on the command line,
latest git commits limited with -n option, or commits in the git range
specified with -r option (default: "origin/master..").
[...]
> 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
Looks good and very useful, thanks :)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: select patches to check with git range
2019-05-09 21:54 ` Thomas Monjalon
2019-05-09 21:54 ` Thomas Monjalon
@ 2019-05-09 22:05 ` Thomas Monjalon
2019-05-09 22:05 ` Thomas Monjalon
1 sibling, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-09 22:05 UTC (permalink / raw)
To: David Marchand; +Cc: dev, ferruh.yigit
09/05/2019 23:54, Thomas Monjalon:
> 22/03/2019 14:16, David Marchand:
> > --- a/devtools/checkpatches.sh
> > +++ b/devtools/checkpatches.sh
> > - usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]]
> > + usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] [-r range]
>
> The option -r should be before the filename arguments,
> and inside the same brackets as -n as they are exclusive.
> (je clair ne pas ;)
>
> > 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).
> > + or latest git commits limited with -n option or commits in the range
> > + specified with -r option (default: origin/master..).
>
> I suggest this reword:
>
> The patches to check can be from stdin, files specified on the command line,
> latest git commits limited with -n option, or commits in the git range
> specified with -r option (default: "origin/master..").
>
> [...]
> > 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
>
> Looks good and very useful, thanks :)
I'm sure I'll find this new option quite useful,
so please add my agreement:
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] devtools: select patches to check with git range
2019-05-09 22:05 ` Thomas Monjalon
@ 2019-05-09 22:05 ` Thomas Monjalon
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-09 22:05 UTC (permalink / raw)
To: David Marchand; +Cc: dev, ferruh.yigit
09/05/2019 23:54, Thomas Monjalon:
> 22/03/2019 14:16, David Marchand:
> > --- a/devtools/checkpatches.sh
> > +++ b/devtools/checkpatches.sh
> > - usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]]
> > + usage: $(basename $0) [-q] [-v] [-nX|patch1 [patch2] ...]] [-r range]
>
> The option -r should be before the filename arguments,
> and inside the same brackets as -n as they are exclusive.
> (je clair ne pas ;)
>
> > 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).
> > + or latest git commits limited with -n option or commits in the range
> > + specified with -r option (default: origin/master..).
>
> I suggest this reword:
>
> The patches to check can be from stdin, files specified on the command line,
> latest git commits limited with -n option, or commits in the git range
> specified with -r option (default: "origin/master..").
>
> [...]
> > 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
>
> Looks good and very useful, thanks :)
I'm sure I'll find this new option quite useful,
so please add my agreement:
Acked-by: Thomas Monjalon <thomas@monjalon.net>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v2] devtools: select patches to check with git range
2019-03-22 13:16 [dpdk-dev] [PATCH] devtools: select patches to check with git range David Marchand
2019-03-22 13:16 ` David Marchand
2019-05-09 21:54 ` Thomas Monjalon
@ 2019-05-10 7:49 ` David Marchand
2019-05-10 7:49 ` David Marchand
2019-05-10 13:44 ` Thomas Monjalon
2 siblings, 2 replies; 10+ messages in thread
From: David Marchand @ 2019-05-10 7:49 UTC (permalink / raw)
To: dev; +Cc: thomas, ferruh.yigit
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 <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
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() { # <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
--
1.8.3.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [dpdk-dev] [PATCH v2] devtools: select patches to check with git range
2019-05-10 7:49 ` [dpdk-dev] [PATCH v2] " David Marchand
@ 2019-05-10 7:49 ` David Marchand
2019-05-10 13:44 ` Thomas Monjalon
1 sibling, 0 replies; 10+ messages in thread
From: David Marchand @ 2019-05-10 7:49 UTC (permalink / raw)
To: dev; +Cc: thomas, ferruh.yigit
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 <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
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() { # <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
--
1.8.3.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] devtools: select patches to check with git range
2019-05-10 7:49 ` [dpdk-dev] [PATCH v2] " David Marchand
2019-05-10 7:49 ` David Marchand
@ 2019-05-10 13:44 ` Thomas Monjalon
2019-05-10 13:44 ` Thomas Monjalon
1 sibling, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-10 13:44 UTC (permalink / raw)
To: David Marchand; +Cc: dev, ferruh.yigit
10/05/2019 09:49, David Marchand:
> 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 <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Applied, thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH v2] devtools: select patches to check with git range
2019-05-10 13:44 ` Thomas Monjalon
@ 2019-05-10 13:44 ` Thomas Monjalon
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-05-10 13:44 UTC (permalink / raw)
To: David Marchand; +Cc: dev, ferruh.yigit
10/05/2019 09:49, David Marchand:
> 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 <david.marchand@redhat.com>
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Applied, thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2019-05-10 13:44 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-22 13:16 [dpdk-dev] [PATCH] devtools: select patches to check with git range David Marchand
2019-03-22 13:16 ` David Marchand
2019-05-09 21:54 ` Thomas Monjalon
2019-05-09 21:54 ` Thomas Monjalon
2019-05-09 22:05 ` Thomas Monjalon
2019-05-09 22:05 ` Thomas Monjalon
2019-05-10 7:49 ` [dpdk-dev] [PATCH v2] " David Marchand
2019-05-10 7:49 ` David Marchand
2019-05-10 13:44 ` Thomas Monjalon
2019-05-10 13:44 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).