From patchwork Fri May 13 23:37:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC, 03/10] create-pull-request: use git request-pull and arbitrary remotes Date: Fri, 13 May 2011 23:37:27 -0000 From: Darren Hart X-Patchwork-Id: 4003 Message-Id: To: openembedded-core@lists.openembedded.org Cc: Martin Jansa Allow for arbitrary remotes via a new -u argument. Remove the hard coded references to the pokylinux repositories. Create the WEB_URL from known remotes. Future patches can add additional WEB_URL mappings for remotes like Git Hub, Gitorious, and kernel.org. Rather than duplicating the git request-pull command ourselves, just use the existing one. Signed-off-by: Darren Hart Cc: Tom Rini Cc: Martin Jansa Cc: Otavio Salvador Cc: Richard Purdie --- scripts/create-pull-request | 74 ++++++++++++++++++++++++++++-------------- 1 files changed, 49 insertions(+), 25 deletions(-) diff --git a/scripts/create-pull-request b/scripts/create-pull-request index b7e015a..c6cf817 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -2,14 +2,13 @@ ODIR=pull-$$ RELATIVE_TO="master" COMMIT_ID="HEAD" -PULL_URL="git://git.pokylinux.org/poky-contrib.git" PREFIX="PATCH" usage() { CMD=$(basename $0) cat < "$PM" +if [ $? -ne 0 ]; then + echo "ERROR: git request-pull reported an error" + exit 1 +fi -Pull URL: $PULL_URL - Branch: $CONTRIB_BRANCH - Browse: $WEB_URL +# The cover letter already has a diffstat, remove it from the pull-msg +# before inserting it. +sed -n "0,\#$REMOTE_URL# p" "$PM" | sed -i "/BLURB HERE/ r /dev/stdin" "$CL" +rm "$PM" -Thanks, - $(git config user.name) <$(git config user.email)> ---- +# Insert the WEB_URL if there is one +if [ -n "$WEB_URL" ]; then + echo " $WEB_URL" | sed -i "\#$REMOTE_URL# r /dev/stdin" "$CL" +fi -EOM -) | sed -i "/BLURB HERE/ r /dev/stdin" "$CL" # If the user specified a message body, insert it into the cover letter and # remove the BLURB token.