Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] patchtest.sh: optionally specify start branch
@ 2018-05-29 13:38 Trevor Woerner
  2018-06-21 15:14 ` Trevor Woerner
  0 siblings, 1 reply; 2+ messages in thread
From: Trevor Woerner @ 2018-05-29 13:38 UTC (permalink / raw)
  To: openembedded-core

Allow the user to optionally specify a starting branch, otherwise assume
master.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 scripts/contrib/patchtest.sh | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/scripts/contrib/patchtest.sh b/scripts/contrib/patchtest.sh
index 7fe566666e..2a4aea1d28 100755
--- a/scripts/contrib/patchtest.sh
+++ b/scripts/contrib/patchtest.sh
@@ -2,7 +2,7 @@
 # ex:ts=4:sw=4:sts=4:et
 # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
 #
-# patchtest: Run patchtest on commits starting at master
+# patchtest: Run patchtest on commits starting at specified branch, or master
 #
 # Copyright (c) 2017, Intel Corporation.
 # All rights reserved.
@@ -29,8 +29,9 @@ pokydir=''
 usage() {
 CMD=$(basename $0)
 cat <<EOM
-Usage: $CMD [-h] [-p pokydir]
-  -p pokydir  Defaults to current directory
+Usage: $CMD [-h] [-p pokydir] [-b startbranch]
+  -p pokydir        Defaults to current directory
+  -b startbranch    Defaults to master
 EOM
 >&2
     exit 1
@@ -46,11 +47,14 @@ function clone() {
     fi
 }
 
-while getopts ":p:h" opt; do
+while getopts ":p:hb:" opt; do
     case $opt in
 	p)
 	    pokydir=$OPTARG
 	    ;;
+	b)
+	    branch=$OPTARG
+	    ;;
 	h)
 	    usage
 	    ;;
@@ -73,6 +77,11 @@ if [ -z "$pokydir" ]; then
     pokydir="$CDIR"
 fi
 
+# default branch to master if the user did not specify otherwise
+if [ -z "$branch" ]; then
+    branch="master"
+fi
+
 PTENV="$PWD/patchtest"
 PT="$PTENV/patchtest"
 PTOE="$PTENV/patchtest-oe"
@@ -99,7 +108,7 @@ pip install -r $PTOE/requirements.txt --quiet
 PATH="$PT:$PT/scripts:$PATH"
 
 # loop through parent to HEAD and execute patchtest on each commit
-for commit in $(git rev-list master..HEAD --reverse)
+for commit in $(git rev-list ${branch}..HEAD --reverse)
 do
     shortlog="$(git log "$commit^1..$commit" --pretty='%h: %aN: %cd: %s')"
     log="$(git format-patch "$commit^1..$commit" --stdout | patchtest - -r $pokydir -s $PTOE/tests --base-commit $commit^1 --json 2>/dev/null | create-summary --fail --only-results)"
-- 
2.17.0.582.gccdcbd54c



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] patchtest.sh: optionally specify start branch
  2018-05-29 13:38 [PATCH] patchtest.sh: optionally specify start branch Trevor Woerner
@ 2018-06-21 15:14 ` Trevor Woerner
  0 siblings, 0 replies; 2+ messages in thread
From: Trevor Woerner @ 2018-06-21 15:14 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2473 bytes --]

ping?

On Tue, May 29, 2018 at 9:38 AM, Trevor Woerner <twoerner@gmail.com> wrote:

> Allow the user to optionally specify a starting branch, otherwise assume
> master.
>
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
>  scripts/contrib/patchtest.sh | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/contrib/patchtest.sh b/scripts/contrib/patchtest.sh
> index 7fe566666e..2a4aea1d28 100755
> --- a/scripts/contrib/patchtest.sh
> +++ b/scripts/contrib/patchtest.sh
> @@ -2,7 +2,7 @@
>  # ex:ts=4:sw=4:sts=4:et
>  # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
>  #
> -# patchtest: Run patchtest on commits starting at master
> +# patchtest: Run patchtest on commits starting at specified branch, or
> master
>  #
>  # Copyright (c) 2017, Intel Corporation.
>  # All rights reserved.
> @@ -29,8 +29,9 @@ pokydir=''
>  usage() {
>  CMD=$(basename $0)
>  cat <<EOM
> -Usage: $CMD [-h] [-p pokydir]
> -  -p pokydir  Defaults to current directory
> +Usage: $CMD [-h] [-p pokydir] [-b startbranch]
> +  -p pokydir        Defaults to current directory
> +  -b startbranch    Defaults to master
>  EOM
>  >&2
>      exit 1
> @@ -46,11 +47,14 @@ function clone() {
>      fi
>  }
>
> -while getopts ":p:h" opt; do
> +while getopts ":p:hb:" opt; do
>      case $opt in
>         p)
>             pokydir=$OPTARG
>             ;;
> +       b)
> +           branch=$OPTARG
> +           ;;
>         h)
>             usage
>             ;;
> @@ -73,6 +77,11 @@ if [ -z "$pokydir" ]; then
>      pokydir="$CDIR"
>  fi
>
> +# default branch to master if the user did not specify otherwise
> +if [ -z "$branch" ]; then
> +    branch="master"
> +fi
> +
>  PTENV="$PWD/patchtest"
>  PT="$PTENV/patchtest"
>  PTOE="$PTENV/patchtest-oe"
> @@ -99,7 +108,7 @@ pip install -r $PTOE/requirements.txt --quiet
>  PATH="$PT:$PT/scripts:$PATH"
>
>  # loop through parent to HEAD and execute patchtest on each commit
> -for commit in $(git rev-list master..HEAD --reverse)
> +for commit in $(git rev-list ${branch}..HEAD --reverse)
>  do
>      shortlog="$(git log "$commit^1..$commit" --pretty='%h: %aN: %cd: %s')"
>      log="$(git format-patch "$commit^1..$commit" --stdout | patchtest -
> -r $pokydir -s $PTOE/tests --base-commit $commit^1 --json 2>/dev/null |
> create-summary --fail --only-results)"
> --
> 2.17.0.582.gccdcbd54c
>
>

[-- Attachment #2: Type: text/html, Size: 3281 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-21 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-29 13:38 [PATCH] patchtest.sh: optionally specify start branch Trevor Woerner
2018-06-21 15:14 ` Trevor Woerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox