diff options
| author | Nitin A Kamble <nitin.a.kamble@intel.com> | 2010-05-17 13:47:40 -0700 |
|---|---|---|
| committer | Nitin A Kamble <nitin.a.kamble@intel.com> | 2010-05-17 13:47:40 -0700 |
| commit | bad2fe6498cf2720e31f5853a96eb56e7eb77ea5 (patch) | |
| tree | 58a60dc7ed30ff10f3dc01c67a6b4d689f6d847e /scripts | |
| parent | ebed56190ec572c048192ad9cf9d3fb3473b818f (diff) | |
| download | poky-bad2fe6498cf2720e31f5853a96eb56e7eb77ea5.tar.gz | |
add a new scripts create-pull-request
This is the 1st version of create-pull-request script.
Using specified local commit-id or branch-name it
generates a short description of the changes;
and using poky-contrib branch-name it generates the
URL where these changes are already pushed
and are available for review and git-pull.
I prepared this script as per the input from Richard Purdie.
Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/create-pull-request | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request new file mode 100755 index 0000000000..2223151956 --- /dev/null +++ b/scripts/create-pull-request | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # | ||
| 3 | # create a pull request for your branch | ||
| 4 | # | ||
| 5 | |||
| 6 | usage() { | ||
| 7 | echo "Error: Invalid arguments." | ||
| 8 | echo "Usage: " | ||
| 9 | echo "$ $0 <commit_id> <contrib_branch>" | ||
| 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 | exit 1 | ||
| 13 | } | ||
| 14 | |||
| 15 | case $# in | ||
| 16 | 2) | ||
| 17 | COMMIT=$1 | ||
| 18 | CONTRIB_BRANCH=$2 | ||
| 19 | shift | ||
| 20 | ;; | ||
| 21 | *) | ||
| 22 | usage | ||
| 23 | ;; | ||
| 24 | esac | ||
| 25 | |||
| 26 | if [ "$COMMIT" = "" ]; then | ||
| 27 | usage | ||
| 28 | fi | ||
| 29 | |||
| 30 | git --no-pager show $COMMIT > /dev/null | ||
| 31 | if [ "$?" != "0" ]; then | ||
| 32 | echo "Invalid Commit." | ||
| 33 | usage | ||
| 34 | fi | ||
| 35 | |||
| 36 | git --no-pager diff master..${COMMIT} | diffstat -p1 | ||
| 37 | echo "" | ||
| 38 | git --no-pager log --no-merges master..${COMMIT} | git --no-pager shortlog | ||
| 39 | |||
| 40 | |||
| 41 | echo "Pull URL: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=${CONTRIB_BRANCH}" | ||
