[oe-commits] Ed Bartosh : create-pull-request: cd to relative directory

git at git.openembedded.org git at git.openembedded.org
Sun Aug 9 07:20:43 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 3042956a86167f89beccc5d05f1fad1844e7c36a
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=3042956a86167f89beccc5d05f1fad1844e7c36a

Author: Ed Bartosh <ed.bartosh at linux.intel.com>
Date:   Wed Aug  5 12:16:00 2015 +0300

create-pull-request: cd to relative directory

create-pull-request -d path creates empty patches if directory
is specified as a path, i.e. ./bitbake or ./bitbake/ or full path.
It behaves expected way only if script is run with -d bitbake, i.e.
relative dir name doesn't contain '\'.

Fixed this unwanted behaviour by changing directory and running
git format-patch in it with --relative, without specifying
relative path as a parameter.

Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/create-pull-request | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 216edfd..be49379 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -177,12 +177,15 @@ mkdir $ODIR
 
 if [ -n "$RELDIR" ]; then
 	ODIR=$(realpath $ODIR)
-	extraopts="--relative=$RELDIR"
+	pushd $RELDIR > /dev/null
+	extraopts="--relative"
 fi
 
 # Generate the patches and cover letter
 git format-patch $extraopts -M40 --subject-prefix="$PREFIX" -n -o $ODIR --thread=shallow --cover-letter $RELATIVE_TO..$COMMIT_ID > /dev/null
 
+[ -n "$RELDIR" ] && popd > /dev/null
+
 # Customize the cover letter
 CL="$ODIR/0000-cover-letter.patch"
 PM="$ODIR/pull-msg"



More information about the Openembedded-commits mailing list