From: Trevor Woerner <twoerner@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] patchtest.sh: optionally specify start branch
Date: Tue, 29 May 2018 09:38:40 -0400 [thread overview]
Message-ID: <20180529133840.11820-1-twoerner@gmail.com> (raw)
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
next reply other threads:[~2018-05-29 13:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 13:38 Trevor Woerner [this message]
2018-06-21 15:14 ` [PATCH] patchtest.sh: optionally specify start branch Trevor Woerner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180529133840.11820-1-twoerner@gmail.com \
--to=twoerner@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.