From bad2fe6498cf2720e31f5853a96eb56e7eb77ea5 Mon Sep 17 00:00:00 2001 From: Nitin A Kamble Date: Mon, 17 May 2010 13:47:40 -0700 Subject: 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 --- scripts/create-pull-request | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 scripts/create-pull-request 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 @@ +#!/bin/bash +# +# create a pull request for your branch +# + +usage() { + echo "Error: Invalid arguments." + echo "Usage: " + echo "$ $0 " + echo " is a commit identifier, like branch-name, HEAD, hex-commit-id" + echo " is the branch-name in the git.pokylinux.org/poky-contrib tree" + exit 1 +} + +case $# in + 2) + COMMIT=$1 + CONTRIB_BRANCH=$2 + shift + ;; + *) + usage + ;; +esac + +if [ "$COMMIT" = "" ]; then + usage +fi + +git --no-pager show $COMMIT > /dev/null +if [ "$?" != "0" ]; then + echo "Invalid Commit." + usage +fi + +git --no-pager diff master..${COMMIT} | diffstat -p1 +echo "" +git --no-pager log --no-merges master..${COMMIT} | git --no-pager shortlog + + +echo "Pull URL: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=${CONTRIB_BRANCH}" -- cgit 1.2.3-korg