Good idea and good work.<br clear="all"><div style="text-align:center"></div><div style="text-align:center"><div align="left" style="font-family:'Times New Roman';font-size:medium"><font face="Arial" color="#333333" size="-1"><br>
<br><b>@g</b></font></div></div><br>
<br><br><div class="gmail_quote">On Fri, Apr 6, 2012 at 00:31, Darren Hart <span dir="ltr"><<a href="mailto:dvhart@linux.intel.com">dvhart@linux.intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is common to use the same remote branch name as the local branch<br>
name. In this case, it would be nice not to have to specify the<br>
remote branch name.<br>
<br>
Make the -b argument optional and assume the remote branch is the same<br>
name as the local branch. Print a NOTE to this effect so as not to<br>
catch the user by surprise:<br>
<br>
NOTE: Assuming remote branch 'notthere', use -b to override.<br>
<br>
If the remote branch doesn't exist, a WARNING is displayed just as if<br>
the user had used -b to specify a non-existent branch:<br>
<br>
WARNING: Branch 'notthere' was not found on the contrib git tree.<br>
Please check your remote and branch parameter before sending.<br>
<br>
Signed-off-by: Darren Hart <<a href="mailto:dvhart@linux.intel.com">dvhart@linux.intel.com</a>><br>
---<br>
<div class="im"> scripts/create-pull-request | 11 ++++++++---<br>
1 files changed, 8 insertions(+), 3 deletions(-)<br>
<br>
</div>diff --git a/scripts/create-pull-request b/scripts/create-pull-request<br>
index 600fa7a..9a8913d 100755<br>
--- a/scripts/create-pull-request<br>
+++ b/scripts/create-pull-request<br>
@@ -34,8 +34,8 @@ RFC=0<br>
usage() {<br>
CMD=$(basename $0)<br>
cat <<EOM<br>
-Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote -b branch<br>
- -b branch Branch name in the specified remote<br>
+Usage: $CMD [-h] [-o output_dir] [-m msg_body_file] [-s subject] [-r relative_to] [-i commit_id] -u remote [-b branch]<br>
+ -b branch Branch name in the specified remote (default: current branch)<br>
-c Create an RFC (Request for Comment) patch series<br>
-h Display this help message<br>
-i commit_id Ending commit (default: HEAD)<br>
@@ -120,7 +120,12 @@ while getopts "b:chi:m:o:p:r:s:u:" OPT; do<br>
esac<br>
done<br>
<br>
-if [ -z "$BRANCH" ] || [ -z "$REMOTE_URL" ]; then<br>
+if [ -z "$BRANCH" ]; then<br>
+ BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)<br>
+ echo "NOTE: Assuming remote branch '$BRANCH', use -b to override."<br>
+fi<br>
+<br>
+if [ -z "$REMOTE_URL" ]; then<br>
usage<br>
exit 1<br>
fi<br>
<div class="HOEnZb"><div class="h5">--<br>
1.7.6.5<br>
<br>
<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core</a><br>
</div></div></blockquote></div><br>