diff --git a/scripts/create-pull-request b/scripts/create-pull-request index b911a64f33..8f7f767b98 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.