* [PATCH v2] create-pull-request: cd to relative directory
@ 2015-08-05 9:16 Ed Bartosh
0 siblings, 0 replies; 2+ messages in thread
From: Ed Bartosh @ 2015-08-05 9:16 UTC (permalink / raw)
To: openembedded-core
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@linux.intel.com>
---
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"
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] create-pull-request: cd to relative directory
@ 2015-08-06 3:33 Khem Raj
2015-08-11 14:24 ` [PATCH v2] " Ed Bartosh
0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2015-08-06 3:33 UTC (permalink / raw)
To: Ed Bartosh; +Cc: Patches and discussions about the oe-core layer
On Wed, Aug 5, 2015 at 2:01 AM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote:
> 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@linux.intel.com>
> ---
> 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..7eac618 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
can we avoid using pushd so it works with non bash shells too ?
> + 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
> +
> # Customize the cover letter
> CL="$ODIR/0000-cover-letter.patch"
> PM="$ODIR/pull-msg"
> --
> 2.1.4
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2] create-pull-request: cd to relative directory
2015-08-06 3:33 [PATCH] " Khem Raj
@ 2015-08-11 14:24 ` Ed Bartosh
0 siblings, 0 replies; 2+ messages in thread
From: Ed Bartosh @ 2015-08-11 14:24 UTC (permalink / raw)
To: openembedded-core
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@linux.intel.com>
---
scripts/create-pull-request | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 216edfd..786fd1ed 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -177,12 +177,16 @@ mkdir $ODIR
if [ -n "$RELDIR" ]; then
ODIR=$(realpath $ODIR)
- extraopts="--relative=$RELDIR"
+ prevdir=$(pwd)
+ cd $RELDIR
+ 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" ] && cd $prevdir
+
# Customize the cover letter
CL="$ODIR/0000-cover-letter.patch"
PM="$ODIR/pull-msg"
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-11 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05 9:16 [PATCH v2] create-pull-request: cd to relative directory Ed Bartosh
-- strict thread matches above, loose matches on Subject: below --
2015-08-06 3:33 [PATCH] " Khem Raj
2015-08-11 14:24 ` [PATCH v2] " Ed Bartosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox