#!/bin/bash # # Copyright (c) 2010-2011, Intel Corporation. # All Rights Reserved # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See # the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # This script is intended to be used to prepare a series of patches # and a cover letter in an appropriate and consistent format for # submission to Open Embedded and The Yocto Project, as well as to # related projects and layers. # ODIR=pull-$$ RELATIVE_TO="master" COMMIT_ID="HEAD" PREFIX="PATCH" RFC=0 usage() { CMD=$(basename $0) cat < /dev/null # Customize the cover letter CL="$ODIR/0000-cover-letter.patch" PM="$ODIR/pull-msg" git request-pull $RELATIVE_TO $REMOTE_URL $COMMIT_ID >> "$PM" if [ $? -ne 0 ]; then echo "ERROR: git request-pull reported an error" exit 1 fi # 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" # If this is an RFC, make that clear in the cover letter if [ $RFC -eq 1 ]; then (cat <