From 28f52e69eef5d217193bc71ea00cfc3a5a9cf082 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Tue, 29 Mar 2011 08:52:58 -0700 Subject: [PATCH] Added `git-pull-request` --- bin/git-pull-request | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/git-pull-request diff --git a/bin/git-pull-request b/bin/git-pull-request new file mode 100755 index 0000000..2a5bf3d --- /dev/null +++ b/bin/git-pull-request @@ -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" \ No newline at end of file