* [PATCH 0/3] create-pull-request: 3 improvements (master branch only)
@ 2016-04-19 2:45 Robert Yang
2016-04-19 2:45 ` [PATCH 1/3] create-pull-request: create branch on remote if not found Robert Yang
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Robert Yang @ 2016-04-19 2:45 UTC (permalink / raw)
To: openembedded-core
The following changes since commit e003ef038819c10f351bb8268b377626c95bb077:
toasterconf.json: Update for krogoth release (2016-04-18 16:48:58 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/cpr
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/cpr
Robert Yang (3):
create-pull-request: create branch on remote if not found
create-pull-request: read remote from env var CONTRIB_REMOTE
create-pull-request: set subject automatically for cover latter
scripts/create-pull-request | 78 +++++++++++++++++++++++++--------------------
1 file changed, 43 insertions(+), 35 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/3] create-pull-request: create branch on remote if not found 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang @ 2016-04-19 2:45 ` Robert Yang 2016-04-19 3:00 ` Bruce Ashfield 2016-04-19 2:45 ` [PATCH 2/3] create-pull-request: read remote from env var CONTRIB_REMOTE Robert Yang ` (4 subsequent siblings) 5 siblings, 1 reply; 11+ messages in thread From: Robert Yang @ 2016-04-19 2:45 UTC (permalink / raw) To: openembedded-core Before this patch, we need two steps to create PULL: * Step 1, create branch: $ git push <contrib> <local_branch>:<remote_branch> * Step 2, create PULL: $ create-pull-request -u <contrib> -l <local_branch> -b <remote_branch> -r <local_branch>~<n> We can see that the args used in step 1 are in step 2, so we can use create-pull-request to create the branch if not found to simplify the steps. [YOCTO #9408] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- scripts/create-pull-request | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 479ad6e..7dc9836 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -173,8 +173,8 @@ esac if [ -n "$WEB_URL" ]; then wget --no-check-certificate -q $WEB_URL -O /dev/null if [ $? -ne 0 ]; then - echo "WARNING: Branch '$BRANCH' was not found on the contrib git tree." - echo " Please check your remote and branch parameter before sending." + echo "Branch '$BRANCH' not found on '$REMOTE', creating it..." + git push $REMOTE $L_BRANCH:$BRANCH echo "" fi fi -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] create-pull-request: create branch on remote if not found 2016-04-19 2:45 ` [PATCH 1/3] create-pull-request: create branch on remote if not found Robert Yang @ 2016-04-19 3:00 ` Bruce Ashfield 2016-04-19 3:13 ` Robert Yang 0 siblings, 1 reply; 11+ messages in thread From: Bruce Ashfield @ 2016-04-19 3:00 UTC (permalink / raw) To: Robert Yang; +Cc: Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 2202 bytes --] On Mon, Apr 18, 2016 at 10:45 PM, Robert Yang <liezhi.yang@windriver.com> wrote: > Before this patch, we need two steps to create PULL: > * Step 1, create branch: > $ git push <contrib> <local_branch>:<remote_branch> > * Step 2, create PULL: > $ create-pull-request -u <contrib> -l <local_branch> -b <remote_branch> > -r <local_branch>~<n> > > We can see that the args used in step 1 are in step 2, so we can use > create-pull-request to create the branch if not found to simplify the > steps. > I think this needs to be optional. When I'm running this script, I'm just looking to have something I've already pushed locally dumped. If I mess up, and don't have the branch that I've used pushed to my remote already (or for whatever reason want/need different branches .. which was broken in previous updates to the script .. grrr), I don't want something pushing a branch without be explicitly giving permission for that to happen. Bruce > > [YOCTO #9408] > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com> > --- > scripts/create-pull-request | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/create-pull-request b/scripts/create-pull-request > index 479ad6e..7dc9836 100755 > --- a/scripts/create-pull-request > +++ b/scripts/create-pull-request > @@ -173,8 +173,8 @@ esac > if [ -n "$WEB_URL" ]; then > wget --no-check-certificate -q $WEB_URL -O /dev/null > if [ $? -ne 0 ]; then > - echo "WARNING: Branch '$BRANCH' was not found on the > contrib git tree." > - echo " Please check your remote and branch > parameter before sending." > + echo "Branch '$BRANCH' not found on '$REMOTE', creating > it..." > + git push $REMOTE $L_BRANCH:$BRANCH > echo "" > fi > fi > -- > 2.7.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" [-- Attachment #2: Type: text/html, Size: 3338 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] create-pull-request: create branch on remote if not found 2016-04-19 3:00 ` Bruce Ashfield @ 2016-04-19 3:13 ` Robert Yang 2016-04-19 12:18 ` Bruce Ashfield 0 siblings, 1 reply; 11+ messages in thread From: Robert Yang @ 2016-04-19 3:13 UTC (permalink / raw) To: Bruce Ashfield; +Cc: Patches and discussions about the oe-core layer On 04/19/2016 11:00 AM, Bruce Ashfield wrote: > > > On Mon, Apr 18, 2016 at 10:45 PM, Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com>> wrote: > > Before this patch, we need two steps to create PULL: > * Step 1, create branch: > $ git push <contrib> <local_branch>:<remote_branch> > * Step 2, create PULL: > $ create-pull-request -u <contrib> -l <local_branch> -b <remote_branch> > -r <local_branch>~<n> > > We can see that the args used in step 1 are in step 2, so we can use > create-pull-request to create the branch if not found to simplify the > steps. > > > I think this needs to be optional. When I'm running this script, I'm just > looking to have something > I've already pushed locally dumped. If I mess up, and don't have the branch that > I've used > pushed to my remote already (or for whatever reason want/need different > branches .. which > was broken in previous updates to the script .. grrr), I don't want something > pushing a branch > without be explicitly giving permission for that to happen. Thanks, how about add an option: "-a automatically push/update local branch (-l) to remote branch (-b)" Then it will always create/update the remote branch when -a is used. // Robert > > Bruce > > > [YOCTO #9408] > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com>> > --- > scripts/create-pull-request | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/create-pull-request b/scripts/create-pull-request > index 479ad6e..7dc9836 100755 > --- a/scripts/create-pull-request > +++ b/scripts/create-pull-request > @@ -173,8 +173,8 @@ esac > if [ -n "$WEB_URL" ]; then > wget --no-check-certificate -q $WEB_URL -O /dev/null > if [ $? -ne 0 ]; then > - echo "WARNING: Branch '$BRANCH' was not found on the contrib > git tree." > - echo " Please check your remote and branch parameter > before sending." > + echo "Branch '$BRANCH' not found on '$REMOTE', creating it..." > + git push $REMOTE $L_BRANCH:$BRANCH > echo "" > fi > fi > -- > 2.7.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > <mailto:Openembedded-core@lists.openembedded.org> > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > > -- > "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its > end" ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] create-pull-request: create branch on remote if not found 2016-04-19 3:13 ` Robert Yang @ 2016-04-19 12:18 ` Bruce Ashfield 2016-04-20 0:48 ` Robert Yang 0 siblings, 1 reply; 11+ messages in thread From: Bruce Ashfield @ 2016-04-19 12:18 UTC (permalink / raw) To: Robert Yang; +Cc: Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 3232 bytes --] On Mon, Apr 18, 2016 at 11:13 PM, Robert Yang <liezhi.yang@windriver.com> wrote: > > > On 04/19/2016 11:00 AM, Bruce Ashfield wrote: > >> >> >> On Mon, Apr 18, 2016 at 10:45 PM, Robert Yang <liezhi.yang@windriver.com >> <mailto:liezhi.yang@windriver.com>> wrote: >> >> Before this patch, we need two steps to create PULL: >> * Step 1, create branch: >> $ git push <contrib> <local_branch>:<remote_branch> >> * Step 2, create PULL: >> $ create-pull-request -u <contrib> -l <local_branch> -b >> <remote_branch> >> -r <local_branch>~<n> >> >> We can see that the args used in step 1 are in step 2, so we can use >> create-pull-request to create the branch if not found to simplify the >> steps. >> >> >> I think this needs to be optional. When I'm running this script, I'm just >> looking to have something >> I've already pushed locally dumped. If I mess up, and don't have the >> branch that >> I've used >> pushed to my remote already (or for whatever reason want/need different >> branches .. which >> was broken in previous updates to the script .. grrr), I don't want >> something >> pushing a branch >> without be explicitly giving permission for that to happen. >> > > Thanks, how about add an option: > > "-a automatically push/update local branch (-l) to remote branch (-b)" > > Then it will always create/update the remote branch when -a is used. > That would meet my requirement. So looks fine to me. Others of course have the right to object :) Cheers, Bruce > > // Robert > > >> Bruce >> >> >> [YOCTO #9408] >> >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com >> <mailto:liezhi.yang@windriver.com>> >> >> --- >> scripts/create-pull-request | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/scripts/create-pull-request b/scripts/create-pull-request >> index 479ad6e..7dc9836 100755 >> --- a/scripts/create-pull-request >> +++ b/scripts/create-pull-request >> @@ -173,8 +173,8 @@ esac >> if [ -n "$WEB_URL" ]; then >> wget --no-check-certificate -q $WEB_URL -O /dev/null >> if [ $? -ne 0 ]; then >> - echo "WARNING: Branch '$BRANCH' was not found on the >> contrib >> git tree." >> - echo " Please check your remote and branch >> parameter >> before sending." >> + echo "Branch '$BRANCH' not found on '$REMOTE', >> creating it..." >> + git push $REMOTE $L_BRANCH:$BRANCH >> echo "" >> fi >> fi >> -- >> 2.7.4 >> >> -- >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> <mailto:Openembedded-core@lists.openembedded.org> >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >> >> >> >> >> -- >> "Thou shalt not follow the NULL pointer, for chaos and madness await thee >> at its >> end" >> > -- "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end" [-- Attachment #2: Type: text/html, Size: 5127 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] create-pull-request: create branch on remote if not found 2016-04-19 12:18 ` Bruce Ashfield @ 2016-04-20 0:48 ` Robert Yang 0 siblings, 0 replies; 11+ messages in thread From: Robert Yang @ 2016-04-20 0:48 UTC (permalink / raw) To: Bruce Ashfield; +Cc: Patches and discussions about the oe-core layer Updated in the repo: (add option -a to auto push or set CONTRIB_AUTO_PUSH in env). git://git.openembedded.org/openembedded-core-contrib rbt/cpr http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/cpr Robert Yang (3): create-pull-request: create branch on remote if not found create-pull-request: read remote from env var CONTRIB_REMOTE create-pull-request: set subject automatically for cover latter commit 973264bfbe57f0d56ba58caf7924710f76bafca8 Author: Robert Yang <liezhi.yang@windriver.com> Date: Tue Apr 19 17:30:03 2016 -0700 create-pull-request: add option -a to auto push Before this patch, we need two steps to create PULL: * Step 1, create branch: $ git push <contrib> <local_branch>:<remote_branch> * Step 2, create PULL: $ create-pull-request -u <contrib> -l <local_branch> -b <remote_branch> -r <local_branch>~<n> We can see that the args used in step 1 are in step 2, so we can use "create-pull-request -a" or set CONTRIB_AUTO_PUSH in to create the branch to simplify the steps. [YOCTO #9408] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 479ad6e..595fda0 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -39,6 +39,8 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to -l local branch Local branch name (default: HEAD) -c Create an RFC (Request for Comment) patch series -h Display this help message + -a Automatically push local branch (-l) to remote branch (-b), + or set CONTRIB_AUTO_PUSH in env -i commit_id Ending commit (default: HEAD) -m msg_body_file The file containing a blurb to be inserted into the summary email -o output_dir Specify the output directory for the messages (default: pull-PID) @@ -59,7 +61,7 @@ EOM } # Parse and validate arguments -while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do +while getopts "b:acd:hi:m:o:p:r:s:u:l:" OPT; do case $OPT in b) BRANCH="$OPTARG" @@ -127,6 +129,9 @@ while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do ;; esac ;; + a) + CONTRIB_AUTO_PUSH="1" + ;; esac done @@ -171,6 +176,11 @@ esac # Perform a sanity test on the web URL. Issue a warning if it is not # accessible, but do not abort as users may want to run offline. if [ -n "$WEB_URL" ]; then + if [ "$CONTRIB_AUTO_PUSH" = "1" ]; then + echo "Pushing '$BRANCH' on '$REMOTE' as requested..." + git push $REMOTE $L_BRANCH:$BRANCH + echo "" + fi wget --no-check-certificate -q $WEB_URL -O /dev/null if [ $? -ne 0 ]; then echo "WARNING: Branch '$BRANCH' was not found on the contrib git tree." // Robert On 04/19/2016 08:18 PM, Bruce Ashfield wrote: > > > On Mon, Apr 18, 2016 at 11:13 PM, Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com>> wrote: > > > > On 04/19/2016 11:00 AM, Bruce Ashfield wrote: > > > > On Mon, Apr 18, 2016 at 10:45 PM, Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com> > <mailto:liezhi.yang@windriver.com <mailto:liezhi.yang@windriver.com>>> > wrote: > > Before this patch, we need two steps to create PULL: > * Step 1, create branch: > $ git push <contrib> <local_branch>:<remote_branch> > * Step 2, create PULL: > $ create-pull-request -u <contrib> -l <local_branch> -b > <remote_branch> > -r <local_branch>~<n> > > We can see that the args used in step 1 are in step 2, so we can use > create-pull-request to create the branch if not found to simplify the > steps. > > > I think this needs to be optional. When I'm running this script, I'm just > looking to have something > I've already pushed locally dumped. If I mess up, and don't have the > branch that > I've used > pushed to my remote already (or for whatever reason want/need different > branches .. which > was broken in previous updates to the script .. grrr), I don't want > something > pushing a branch > without be explicitly giving permission for that to happen. > > > Thanks, how about add an option: > > "-a automatically push/update local branch (-l) to remote branch (-b)" > > Then it will always create/update the remote branch when -a is used. > > > That would meet my requirement. So looks fine to me. Others of course have the > right to object :) > > Cheers, > > Bruce > > > // Robert > > > Bruce > > > [YOCTO #9408] > > Signed-off-by: Robert Yang <liezhi.yang@windriver.com > <mailto:liezhi.yang@windriver.com> > <mailto:liezhi.yang@windriver.com <mailto:liezhi.yang@windriver.com>>> > > --- > scripts/create-pull-request | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/create-pull-request b/scripts/create-pull-request > index 479ad6e..7dc9836 100755 > --- a/scripts/create-pull-request > +++ b/scripts/create-pull-request > @@ -173,8 +173,8 @@ esac > if [ -n "$WEB_URL" ]; then > wget --no-check-certificate -q $WEB_URL -O /dev/null > if [ $? -ne 0 ]; then > - echo "WARNING: Branch '$BRANCH' was not found on > the contrib > git tree." > - echo " Please check your remote and branch > parameter > before sending." > + echo "Branch '$BRANCH' not found on '$REMOTE', > creating it..." > + git push $REMOTE $L_BRANCH:$BRANCH > echo "" > fi > fi > -- > 2.7.4 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > <mailto:Openembedded-core@lists.openembedded.org> > <mailto:Openembedded-core@lists.openembedded.org > <mailto:Openembedded-core@lists.openembedded.org>> > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > > -- > "Thou shalt not follow the NULL pointer, for chaos and madness await > thee at its > end" > > > > > -- > "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its > end" ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] create-pull-request: read remote from env var CONTRIB_REMOTE 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang 2016-04-19 2:45 ` [PATCH 1/3] create-pull-request: create branch on remote if not found Robert Yang @ 2016-04-19 2:45 ` Robert Yang 2016-04-19 2:45 ` [PATCH 3/3] create-pull-request: set subject automatically for cover latter Robert Yang ` (3 subsequent siblings) 5 siblings, 0 replies; 11+ messages in thread From: Robert Yang @ 2016-04-19 2:45 UTC (permalink / raw) To: openembedded-core So that we don't have specify "-u <contrib>" everytime, and CONTRIB_REMOTE can be overrided by -u. [YOCTO #9409] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- scripts/create-pull-request | 66 +++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 7dc9836..613e7ae 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -45,7 +45,7 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to -p prefix Use [prefix N/M] instead of [PATCH N/M] as the subject prefix -r relative_to Starting commit (default: master) -s subject The subject to be inserted into the summary email - -u remote The git remote where the branch is located + -u remote The git remote where the branch is located, or set CONTRIB_REMOTE in env -d relative_dir Generate patches relative to directory Examples: @@ -58,6 +58,7 @@ Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to EOM } +REMOTE="$CONTRIB_REMOTE" # Parse and validate arguments while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do case $OPT in @@ -101,35 +102,42 @@ while getopts "b:cd:hi:m:o:p:r:s:u:l:" OPT; do ;; u) REMOTE="$OPTARG" - REMOTE_URL=$(git config remote.$REMOTE.url) - if [ $? -ne 0 ]; then - echo "ERROR: git config failed to find a url for '$REMOTE'" - echo - echo "To add a remote url for $REMOTE, use:" - echo " git config remote.$REMOTE.url <url>" - exit 1 - fi - - # Rewrite private URLs to public URLs - # Determine the repository name for use in the WEB_URL later - case "$REMOTE_URL" in - *@*) - USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?" - PROTO_RE="[a-z][a-z+]*://" - GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)" - REMOTE_URL=${REMOTE_URL%.git} - REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\4#") - REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\3/\4#") - ;; - *) - echo "WARNING: Unrecognized remote URL: $REMOTE_URL" - echo " The pull and browse URLs will likely be incorrect" - ;; - esac ;; esac done +if [ -z "$REMOTE" ]; then + echo "ERROR: Missing parameter -u or CONTRIB_REMOTE in env, no git remote!" + usage + exit 1 +fi + +REMOTE_URL=$(git config remote.$REMOTE.url) +if [ $? -ne 0 ]; then + echo "ERROR: git config failed to find a url for '$REMOTE'" + echo + echo "To add a remote url for $REMOTE, use:" + echo " git config remote.$REMOTE.url <url>" + exit 1 +fi + +# Rewrite private URLs to public URLs +# Determine the repository name for use in the WEB_URL later +case "$REMOTE_URL" in +*@*) + USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?" + PROTO_RE="[a-z][a-z+]*://" + GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)" + REMOTE_URL=${REMOTE_URL%.git} + REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\4#") + REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\3/\4#") + ;; +*) + echo "WARNING: Unrecognized remote URL: $REMOTE_URL" + echo " The pull and browse URLs will likely be incorrect" + ;; +esac + if [ -z "$BRANCH" ]; then BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2) echo "NOTE: Assuming remote branch '$BRANCH', use -b to override." @@ -140,12 +148,6 @@ if [ -z "$L_BRANCH" ]; then echo "NOTE: Assuming local branch HEAD, use -l to override." fi -if [ -z "$REMOTE_URL" ]; then - echo "ERROR: Missing parameter -u, no git remote!" - usage - exit 1 -fi - if [ $RFC -eq 1 ]; then PREFIX="RFC $PREFIX" fi -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] create-pull-request: set subject automatically for cover latter 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang 2016-04-19 2:45 ` [PATCH 1/3] create-pull-request: create branch on remote if not found Robert Yang 2016-04-19 2:45 ` [PATCH 2/3] create-pull-request: read remote from env var CONTRIB_REMOTE Robert Yang @ 2016-04-19 2:45 ` Robert Yang 2016-04-22 8:27 ` [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang ` (2 subsequent siblings) 5 siblings, 0 replies; 11+ messages in thread From: Robert Yang @ 2016-04-19 2:45 UTC (permalink / raw) To: openembedded-core Set cover letter's subject automatically as the patch's subject when there is only one patch and "-s" not used. [YOCTO #9410] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> --- scripts/create-pull-request | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/create-pull-request b/scripts/create-pull-request index 613e7ae..660f3cf 100755 --- a/scripts/create-pull-request +++ b/scripts/create-pull-request @@ -251,7 +251,13 @@ if [ -n "$BODY" ]; then sed -i "/BLURB HERE/ d" "$CL" fi -# If the user specified a subject, replace the SUBJECT token with it. +# Set subject automatically if there is only one patch +patch_cnt=`git log --pretty=oneline ${RELATIVE_TO}..${L_BRANCH} | wc -l` +if [ -z "$SUBJECT" -a $patch_cnt -eq 1 ]; then + SUBJECT="`git log --format=%s ${RELATIVE_TO}..${L_BRANCH}`" +fi + +# Replace the SUBJECT token with it. if [ -n "$SUBJECT" ]; then sed -i -e "s/\*\*\* SUBJECT HERE \*\*\*/$SUBJECT/" "$CL" fi -- 2.7.4 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] create-pull-request: 3 improvements (master branch only) 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang ` (2 preceding siblings ...) 2016-04-19 2:45 ` [PATCH 3/3] create-pull-request: set subject automatically for cover latter Robert Yang @ 2016-04-22 8:27 ` Robert Yang 2016-05-11 7:33 ` Robert Yang 2016-08-02 8:53 ` Robert Yang 5 siblings, 0 replies; 11+ messages in thread From: Robert Yang @ 2016-04-22 8:27 UTC (permalink / raw) To: openembedded-core I updated the patches a little: * Updated the env var to avoid confusion: CONTRIB_REMOTE -> CPR_CONTRIB_REMOTE CONTRIB_AUTO_PUSH -> CPR_CONTRIB_AUTO_PUSH git://git.openembedded.org/openembedded-core-contrib rbt/cpr http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/cpr Robert Yang (3): create-pull-request: create branch on remote if not found create-pull-request: read remote from env var CONTRIB_REMOTE create-pull-request: set subject automatically for cover latter // Robert On 04/19/2016 10:45 AM, Robert Yang wrote: > The following changes since commit e003ef038819c10f351bb8268b377626c95bb077: > > toasterconf.json: Update for krogoth release (2016-04-18 16:48:58 +0100) > > are available in the git repository at: > > git://git.openembedded.org/openembedded-core-contrib rbt/cpr > http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/cpr > > Robert Yang (3): > create-pull-request: create branch on remote if not found > create-pull-request: read remote from env var CONTRIB_REMOTE > create-pull-request: set subject automatically for cover latter > > scripts/create-pull-request | 78 +++++++++++++++++++++++++-------------------- > 1 file changed, 43 insertions(+), 35 deletions(-) > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] create-pull-request: 3 improvements (master branch only) 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang ` (3 preceding siblings ...) 2016-04-22 8:27 ` [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang @ 2016-05-11 7:33 ` Robert Yang 2016-08-02 8:53 ` Robert Yang 5 siblings, 0 replies; 11+ messages in thread From: Robert Yang @ 2016-05-11 7:33 UTC (permalink / raw) To: openembedded-core On 04/19/2016 10:45 AM, Robert Yang wrote: > The following changes since commit e003ef038819c10f351bb8268b377626c95bb077: > > toasterconf.json: Update for krogoth release (2016-04-18 16:48:58 +0100) > > are available in the git repository at: > > git://git.openembedded.org/openembedded-core-contrib rbt/cpr > http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/cpr > > Robert Yang (3): > create-pull-request: create branch on remote if not found > create-pull-request: read remote from env var CONTRIB_REMOTE > create-pull-request: set subject automatically for cover latter ping. // Robert > > scripts/create-pull-request | 78 +++++++++++++++++++++++++-------------------- > 1 file changed, 43 insertions(+), 35 deletions(-) > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/3] create-pull-request: 3 improvements (master branch only) 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang ` (4 preceding siblings ...) 2016-05-11 7:33 ` Robert Yang @ 2016-08-02 8:53 ` Robert Yang 5 siblings, 0 replies; 11+ messages in thread From: Robert Yang @ 2016-08-02 8:53 UTC (permalink / raw) To: openembedded-core Ping. // Robert On 04/19/2016 10:45 AM, Robert Yang wrote: > The following changes since commit e003ef038819c10f351bb8268b377626c95bb077: > > toasterconf.json: Update for krogoth release (2016-04-18 16:48:58 +0100) > > are available in the git repository at: > > git://git.openembedded.org/openembedded-core-contrib rbt/cpr > http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/cpr > > Robert Yang (3): > create-pull-request: create branch on remote if not found > create-pull-request: read remote from env var CONTRIB_REMOTE > create-pull-request: set subject automatically for cover latter > > scripts/create-pull-request | 78 +++++++++++++++++++++++++-------------------- > 1 file changed, 43 insertions(+), 35 deletions(-) > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-08-02 8:53 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-04-19 2:45 [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang 2016-04-19 2:45 ` [PATCH 1/3] create-pull-request: create branch on remote if not found Robert Yang 2016-04-19 3:00 ` Bruce Ashfield 2016-04-19 3:13 ` Robert Yang 2016-04-19 12:18 ` Bruce Ashfield 2016-04-20 0:48 ` Robert Yang 2016-04-19 2:45 ` [PATCH 2/3] create-pull-request: read remote from env var CONTRIB_REMOTE Robert Yang 2016-04-19 2:45 ` [PATCH 3/3] create-pull-request: set subject automatically for cover latter Robert Yang 2016-04-22 8:27 ` [PATCH 0/3] create-pull-request: 3 improvements (master branch only) Robert Yang 2016-05-11 7:33 ` Robert Yang 2016-08-02 8:53 ` Robert Yang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox