Added git-pull-request

This commit is contained in:
Tj Holowaychuk 2011-03-29 08:52:58 -07:00
parent 3315c8e19a
commit 28f52e69ee

15
bin/git-pull-request Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
request=$1
repo=${PWD##*/}
user=`git config github.user`
url="https://github.com/$user/$repo/pull/$request.patch"
test -z "$request" && echo "pull request number required" && exit 1
test -z "$repo" && echo "failed to detect repo" && exit 2
test -z "$user" && echo "failed to fetch github.user" && exit 3
echo "pulling $url"
curl -# $url \
| git am --signoff \
&& echo "completed pull request $request"