From 847fa2542aad8233d31076d8eaf4ba3168a79eae Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Fri, 13 May 2011 10:44:49 -0700 Subject: create-pull-request: use git request-pull and arbitrary remotes 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 Acked-by: Joshua Lock Acked-by: Otavio Salvador Acked-by: Tom Rini Cc: Tom Rini Cc: Martin Jansa Cc: Otavio Salvador Cc: Richard Purdie Cc: Joshua Lock --- scripts/create-pull-request | 78 ++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 26 deletions(-) (limited to 'scripts/create-pull-request') diff --git a/scripts/create-pull-request b/scripts/create-pull-request index b911a64f3..8f7f767b9 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -2,15 +2,13 @@ ODIR=pull-$$ RELATIVE_TO="master" COMMIT_ID="HEAD" -PULL_URL="git://git.openembedded.org/openembedded-core-contrib" -WEB_URL_PREFIX="http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=" 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. -- cgit v1.2.3