From be5362b02507b4a7eda60238ce5111e2c9bb69ef Mon Sep 17 00:00:00 2001 From: meza Date: Thu, 11 Sep 2014 13:10:01 +0100 Subject: [PATCH] Added option to specify base --- bin/git-pull-request | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/git-pull-request b/bin/git-pull-request index 494bc40..e9a2e44 100755 --- a/bin/git-pull-request +++ b/bin/git-pull-request @@ -10,7 +10,7 @@ abort() { } # -# Produce json with , <body>, and <head> +# Produce json with <title>, <body>, <head> and <base> # json() { @@ -19,7 +19,7 @@ json() { "title": "$1", "body": "$2", "head": "$3", - "base": "master" + "base": "$4" } EOF } @@ -48,10 +48,17 @@ echo " create pull-request for $project '$branch'" echo printf " title: " && read title printf " body: " && read body +printf " base [master]: " && read base echo # create pull request -body=$(json "$title" "$body" $branch) +if [ -z "$base" ] +then + base="master" +fi + +body=$(json "$title" "$body" $branch "$base") + curl -u "$user" "https://api.github.com/repos/$project/pulls" -d "$body"