Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] create-pull-request: Assume remote branch from local branch
@ 2012-04-05 21:31 Darren Hart
  2012-04-05 21:31 ` [PATCH 1/1] " Darren Hart
  2012-04-10 15:22 ` [PATCH 0/1] " Saul Wold
  0 siblings, 2 replies; 4+ messages in thread
From: Darren Hart @ 2012-04-05 21:31 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 3e4562500956550dbae5467a5fe9289f1d32f775:

  self-hosted-image: Increase space for build and allow builder user sudo access (2012-04-04 17:17:11 +0100)

are available in the git repository at:
  git://git.yoctoproject.org/user-contrib/dvhart/oe-core scripts
  http://git.yoctoproject.org/cgit.cgi/user-contrib/dvhart/oe-core/log/?h=scripts

Darren Hart (1):
  create-pull-request: Assume remote branch from local branch

 scripts/create-pull-request |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

-- 
1.7.6.5




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] create-pull-request: Assume remote branch from local branch
  2012-04-05 21:31 [PATCH 0/1] create-pull-request: Assume remote branch from local branch Darren Hart
@ 2012-04-05 21:31 ` Darren Hart
  2012-04-05 22:25   ` Andrei Gherzan
  2012-04-10 15:22 ` [PATCH 0/1] " Saul Wold
  1 sibling, 1 reply; 4+ messages in thread
From: Darren Hart @ 2012-04-05 21:31 UTC (permalink / raw)
  To: openembedded-core

It is common to use the same remote branch name as the local branch
name. In this case, it would be nice not to have to specify the
remote branch name.

Make the -b argument optional and assume the remote branch is the same
name as the local branch. Print a NOTE to this effect so as not to
catch the user by surprise:

NOTE: Assuming remote branch 'notthere', use -b to override.

If the remote branch doesn't exist, a WARNING is displayed just as if
the user had used -b to specify a non-existent branch:

WARNING: Branch 'notthere' was not found on the contrib git tree.
         Please check your remote and branch parameter before sending.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 scripts/create-pull-request |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 600fa7a..9a8913d 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -34,8 +34,8 @@ RFC=0
 usage() {
 CMD=$(basename $0)
 cat <<EOM
-Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote -b branch
-  -b branch           Branch name in the specified remote
+Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote [-b branch]
+  -b branch           Branch name in the specified remote (default: current branch)
   -c                  Create an RFC (Request for Comment) patch series
   -h                  Display this help message
   -i commit_id        Ending commit (default: HEAD)
@@ -120,7 +120,12 @@ while getopts "b:chi:m:o:p:r:s:u:" OPT; do
 	esac
 done
 
-if [ -z "$BRANCH" ] || [ -z "$REMOTE_URL" ]; then
+if [ -z "$BRANCH" ]; then
+	BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
+	echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
+fi
+	
+if [ -z "$REMOTE_URL" ]; then
 	usage
 	exit 1
 fi
-- 
1.7.6.5




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] create-pull-request: Assume remote branch from local branch
  2012-04-05 21:31 ` [PATCH 1/1] " Darren Hart
@ 2012-04-05 22:25   ` Andrei Gherzan
  0 siblings, 0 replies; 4+ messages in thread
From: Andrei Gherzan @ 2012-04-05 22:25 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]

Good idea and good work.


*@g*



On Fri, Apr 6, 2012 at 00:31, Darren Hart <dvhart@linux.intel.com> wrote:

> It is common to use the same remote branch name as the local branch
> name. In this case, it would be nice not to have to specify the
> remote branch name.
>
> Make the -b argument optional and assume the remote branch is the same
> name as the local branch. Print a NOTE to this effect so as not to
> catch the user by surprise:
>
> NOTE: Assuming remote branch 'notthere', use -b to override.
>
> If the remote branch doesn't exist, a WARNING is displayed just as if
> the user had used -b to specify a non-existent branch:
>
> WARNING: Branch 'notthere' was not found on the contrib git tree.
>         Please check your remote and branch parameter before sending.
>
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> ---
>  scripts/create-pull-request |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/create-pull-request b/scripts/create-pull-request
> index 600fa7a..9a8913d 100755
> --- a/scripts/create-pull-request
> +++ b/scripts/create-pull-request
> @@ -34,8 +34,8 @@ RFC=0
>  usage() {
>  CMD=$(basename $0)
>  cat <<EOM
> -Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r
> relative_to] [-i commit_id] -u remote -b branch
> -  -b branch           Branch name in the specified remote
> +Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r
> relative_to] [-i commit_id] -u remote [-b branch]
> +  -b branch           Branch name in the specified remote (default:
> current branch)
>   -c                  Create an RFC (Request for Comment) patch series
>   -h                  Display this help message
>   -i commit_id        Ending commit (default: HEAD)
> @@ -120,7 +120,12 @@ while getopts "b:chi:m:o:p:r:s:u:" OPT; do
>        esac
>  done
>
> -if [ -z "$BRANCH" ] || [ -z "$REMOTE_URL" ]; then
> +if [ -z "$BRANCH" ]; then
> +       BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)
> +       echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."
> +fi
> +
> +if [ -z "$REMOTE_URL" ]; then
>        usage
>        exit 1
>  fi
> --
> 1.7.6.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 3442 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] create-pull-request: Assume remote branch from local branch
  2012-04-05 21:31 [PATCH 0/1] create-pull-request: Assume remote branch from local branch Darren Hart
  2012-04-05 21:31 ` [PATCH 1/1] " Darren Hart
@ 2012-04-10 15:22 ` Saul Wold
  1 sibling, 0 replies; 4+ messages in thread
From: Saul Wold @ 2012-04-10 15:22 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Darren Hart

On 04/05/2012 02:31 PM, Darren Hart wrote:
> The following changes since commit 3e4562500956550dbae5467a5fe9289f1d32f775:
>
>    self-hosted-image: Increase space for build and allow builder user sudo access (2012-04-04 17:17:11 +0100)
>
> are available in the git repository at:
>    git://git.yoctoproject.org/user-contrib/dvhart/oe-core scripts
>    http://git.yoctoproject.org/cgit.cgi/user-contrib/dvhart/oe-core/log/?h=scripts
>
> Darren Hart (1):
>    create-pull-request: Assume remote branch from local branch
>
>   scripts/create-pull-request |   11 ++++++++---
>   1 files changed, 8 insertions(+), 3 deletions(-)
>
Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-10 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 21:31 [PATCH 0/1] create-pull-request: Assume remote branch from local branch Darren Hart
2012-04-05 21:31 ` [PATCH 1/1] " Darren Hart
2012-04-05 22:25   ` Andrei Gherzan
2012-04-10 15:22 ` [PATCH 0/1] " Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox