diff options
| -rwxr-xr-x | scripts/create-pull-request | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request deleted file mode 100755 index c9a7916611..0000000000 --- a/scripts/create-pull-request +++ /dev/null | |||
| @@ -1,86 +0,0 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # | ||
| 3 | # create a pull request for your branch | ||
| 4 | # | ||
| 5 | |||
| 6 | usage() { | ||
| 7 | echo "Usage: " | ||
| 8 | echo "$ $0 [-r <relative_to>] [-i <commit_id>] -b <contrib_branch>" | ||
| 9 | echo " <relative_to> is a commit identifier, like branch-name, HEAD, hex-commit-id" | ||
| 10 | echo " <commit_id> is a commit identifier, like branch-name, HEAD, hex-commit-id" | ||
| 11 | echo " <contrib_branch> is the branch-name in the git.pokylinux.org/poky-contrib tree" | ||
| 12 | echo " If <relative_to> is not specified then relative to master is assumed" | ||
| 13 | echo " If <commit_id> is not specified then it is assumed as HEAD" | ||
| 14 | echo " For Example:" | ||
| 15 | echo " $0 -r master -i misc -b nitin/misc " | ||
| 16 | echo " $0 -b nitin/misc " | ||
| 17 | echo " $0 -r distro/master -i nitin/distro -b nitin/distro " | ||
| 18 | exit 1 | ||
| 19 | } | ||
| 20 | |||
| 21 | while [ $# -ne 0 ] # loop over arguments | ||
| 22 | do | ||
| 23 | |||
| 24 | case $1 in | ||
| 25 | -r ) | ||
| 26 | shift | ||
| 27 | RELATIVE_TO=$1 | ||
| 28 | shift | ||
| 29 | ;; | ||
| 30 | -i ) | ||
| 31 | shift | ||
| 32 | COMMIT_ID=$1 | ||
| 33 | shift | ||
| 34 | ;; | ||
| 35 | -b ) | ||
| 36 | shift | ||
| 37 | CONTRIB_BRANCH=$1 | ||
| 38 | shift | ||
| 39 | ;; | ||
| 40 | *) | ||
| 41 | usage | ||
| 42 | ;; | ||
| 43 | esac | ||
| 44 | done | ||
| 45 | |||
| 46 | if [ "${COMMIT_ID}" = "" ]; then | ||
| 47 | COMMIT_ID=HEAD | ||
| 48 | echo "Note: <commit_id> parameter assumed as 'HEAD'" | ||
| 49 | fi | ||
| 50 | |||
| 51 | if [ "${RELATIVE_TO}" = "" ]; then | ||
| 52 | RELATIVE_TO=master | ||
| 53 | echo "Note: <relative_to> parameter assumed as 'master'" | ||
| 54 | fi | ||
| 55 | |||
| 56 | if [ "${CONTRIB_BRANCH}" = "" ]; then | ||
| 57 | echo "Error: Parameter <contrib_branch> not specified" | ||
| 58 | usage | ||
| 59 | fi | ||
| 60 | |||
| 61 | git --no-pager show ${COMMIT_ID} > /dev/null | ||
| 62 | if [ "$?" != "0" ]; then | ||
| 63 | echo "Error: Invalid <commit_id> parameter specified" | ||
| 64 | usage | ||
| 65 | fi | ||
| 66 | |||
| 67 | git --no-pager show ${RELATIVE_TO} > /dev/null | ||
| 68 | if [ "$?" != "0" ]; then | ||
| 69 | echo "Error: Invalid <relative_to> parameter specified: ${RELATIVE_TO}" | ||
| 70 | usage | ||
| 71 | fi | ||
| 72 | |||
| 73 | echo "" | ||
| 74 | git --no-pager diff ${RELATIVE_TO}..${COMMIT_ID} | diffstat -p1 | ||
| 75 | echo "" | ||
| 76 | git --no-pager log --no-merges ${RELATIVE_TO}..${COMMIT_ID} | git --no-pager shortlog | ||
| 77 | |||
| 78 | PULL_URL="http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=${CONTRIB_BRANCH}" | ||
| 79 | |||
| 80 | echo "Pull URL: ${PULL_URL}" | ||
| 81 | |||
| 82 | wget -q ${PULL_URL} -O - | grep -q "Invalid branch:\ ${CONTRIB_BRANCH}" | ||
| 83 | if [ "$?" == "0" ]; then | ||
| 84 | echo "Warning: Branch named '${CONTRIB_BRANCH}' was not found on contrib git tree" | ||
| 85 | echo "Check your <contrib-branch> parameter" | ||
| 86 | fi | ||
