summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPetter Mabäcker <petter@technux.se>2015-11-24 13:45:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-12-01 21:32:02 +0000
commit2d21e5d233be168abfb0a6f9ef87a6ea7ddf007b (patch)
tree402b60a9e7d653678bec506914eb481cc219257e /scripts
parentc63b36fb39367ce422ff45be91855c7493e9e200 (diff)
downloadpoky-2d21e5d233be168abfb0a6f9ef87a6ea7ddf007b.tar.gz
create-pull-request: handle empty ODIR
In some situations you might end-up with an empty ODIR (pull-xx/). The most common reason is that you have applied your patches on 'master' branch (or you are by mistake standing on the 'master' branch), this will result in the default behavior that 'git format-patch' will try to diff master..master. Solve this by aborting the script with a proper error code and message if ODIR is empty after the 'git format-patch' call (that is expected to generate the cover-letter and patches). (From OE-Core rev: 5ef9249bbae4f08eb9b981d10f31bd3348449c82) Signed-off-by: Petter Mabäcker <petter@technux.se> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create-pull-request8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 19ba58869f..a3744cceaa 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -185,6 +185,14 @@ fi
185# Generate the patches and cover letter 185# Generate the patches and cover letter
186git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null 186git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null
187 187
188if [ -z "$(ls -A $ODIR 2> /dev/null)" ]; then
189 echo "ERROR: $ODIR is empty, no cover letter and patches was generated!"
190 echo " This is most likely due to that \$RRELATIVE_TO..\$COMMIT_ID"
191 echo " ($RELATIVE_TO..$COMMIT_ID) don't contain any differences."
192 rmdir $ODIR
193 exit 1
194fi
195
188[ -n "$RELDIR" ] && cd $pdir 196[ -n "$RELDIR" ] && cd $pdir
189 197
190# Customize the cover letter 198# Customize the cover letter