From 54f3b65b68d512d101f8cb657e91f3249fff4ee1 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 9 Feb 2012 08:09:20 -0800 Subject: [PATCH] Removed git-pull-request(1) not very useful since you have to lookup the number, in which case you might as well just copy/paste the url and git am --- Readme.md | 14 ----- bin/git-gh-oauth | 17 ------ bin/git-pull-request | 42 -------------- man/git-extras.md | 1 - man/git-pull-request.1 | 36 ------------ man/git-pull-request.html | 113 -------------------------------------- man/git-pull-request.md | 29 ---------- 7 files changed, 252 deletions(-) delete mode 100644 bin/git-gh-oauth delete mode 100755 bin/git-pull-request delete mode 100644 man/git-pull-request.1 delete mode 100644 man/git-pull-request.html delete mode 100644 man/git-pull-request.md diff --git a/Readme.md b/Readme.md index b2234e9..2d7706a 100644 --- a/Readme.md +++ b/Readme.md @@ -36,7 +36,6 @@ $ brew install git-extras - `git effort` - `git changelog` - `git commits-since` - - `git pull-request` - `git count` - `git create-branch` - `git delete-branch` @@ -109,19 +108,6 @@ $ git feature finish dependencies All of this works with `feature`, `bug`, or `refactor`. - -## git-pull-request <number> - -Pull a GitHub pull-request `number`, and apply it -via `git am`. - -The git config `github.user` must be present, and the dirname must -map to `https://github.com//`. - -```bash -git pull-request 604 -``` - ## git-contrib <author> Output `author`'s contributions to a project: diff --git a/bin/git-gh-oauth b/bin/git-gh-oauth deleted file mode 100644 index 30d9b2a..0000000 --- a/bin/git-gh-oauth +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -user=`git config github.user` -test -z "$user" && echo "failed to fetch github.user" 1>&2 && exit 1 -oauthToken=`git config github.oauthToken` -if [ -z $oauthToken ] ; then - echo "Github oAuth token not found. Creating a new one." - stty_orig=`stty -g` - stty -echo - printf "Github password:" - read passwd - stty $stty_orig - url="https://api.github.com/authorizations" - oauthToken=$(curl -# -u "$user:$passwd" $url -d '{"scopes": ["repo", "user", "gist"]}' | jshon -e token | sed -e 's/"//g') - git config --global github.oauthToken $oauthToken -fi -echo $oauthToken diff --git a/bin/git-pull-request b/bin/git-pull-request deleted file mode 100755 index eb67b28..0000000 --- a/bin/git-pull-request +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -# check if arg 1 is a number or not -echo $1 | egrep "^[[:digit:]]+$" > /dev/null -is_not_number=$? -repo=${PWD##*/} -user=`git config github.user` - -test -z "$repo" && echo "failed to detect repo" 1>&2 && exit 2 -test -z "$user" && echo "failed to fetch github.user" 1>&2 && exit 3 - -if [ ! $is_not_number ] ; then - # apply existing pull request - url="https://github.com/$user/$repo/pull/$1.patch" - echo "pulling $url" - curl -# $url \ - | git am --signoff \ - && echo "completed pull request $request" -else - # push - branchname=`git branch --no-color | sed -n -e 's/^\* \(.*\)/\1/p'` - echo "git push origin $branchname" - git push origin $branchname - - # create new pull request - url="https://api.github.com/repos/$user/$repo/pulls" - echo "creating pull request" - oauthToken=`git gh-oauth` - body="{\"title\": \"$branchname\", \"head\": \"$user:$branchname\", \"base\": \"master\"}" - curl_result=$(curl -H "Authorization: token $oauthToken" $url -d "$body" --silent \ - --write-out "%{http_code}") - json=`echo ${curl_result} | sed 's/...$//'` - http_code=`echo ${curl_request} | perl -pe 's/(.*)(...)$/$2/'` - if [ "${http_code:0:1}" == "2" ] ; then - pr_num=`echo "$json" | jshon -e number` - echo "Created pull request #${pr_num}" - else - echo "$json" | jshon -e message - echo "$json" - fi -fi - diff --git a/man/git-extras.md b/man/git-extras.md index 82af460..636a274 100644 --- a/man/git-extras.md +++ b/man/git-extras.md @@ -20,7 +20,6 @@ git-extras(1) -- Awesome GIT utilities - `git-summary` repository summary & contrib - `git-touch` touch and add file to the index - `git-undo` undo one or more of the latest commits - - `git-pull-request` pulls the given request from github ## AUTHOR diff --git a/man/git-pull-request.1 b/man/git-pull-request.1 deleted file mode 100644 index 036fe60..0000000 --- a/man/git-pull-request.1 +++ /dev/null @@ -1,36 +0,0 @@ -.\" generated with Ronn/v0.7.3 -.\" http://github.com/rtomayko/ronn/tree/0.7.3 -. -.TH "GIT\-PULL\-REQUEST" "1" "March 2011" "" "Git Extras" -. -.SH "NAME" -\fBgit\-pull\-request\fR \- Pulls a github request -. -.SH "SYNOPSIS" -\fBgit\-pull\-request\fR [number] -. -.SH "DESCRIPTION" -Pulls the given request number the project in the \fBCWD\fR and applies it via \fBgit am\fR\. -. -.SH "EXAMPLES" -Pull https://github\.com/visionmedia/express/pull/604\. -. -.IP "" 4 -. -.nf - -$ cd projects/express -$ git pull\-request 604 -. -.fi -. -.IP "" 0 -. -.SH "AUTHOR" -Written by TJ Holowaychuk <\fItj@vision\-media\.ca\fR> -. -.SH "REPORTING BUGS" -<\fIhttp://github\.com/visionmedia/git\-extras/issues\fR> -. -.SH "SEE ALSO" -<\fIhttp://github\.com/visionmedia/git\-extras\fR> diff --git a/man/git-pull-request.html b/man/git-pull-request.html deleted file mode 100644 index f6d80a9..0000000 --- a/man/git-pull-request.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - git-pull-request(1) - Pulls a github request - - - - -
- - - -
    -
  1. git-pull-request(1)
  2. -
  3. Git Extras
  4. -
  5. git-pull-request(1)
  6. -
- -

NAME

-

- git-pull-request - Pulls a github request -

- -

SYNOPSIS

- -

git-pull-request [number]

- -

DESCRIPTION

- -

Pulls the given request number the project in the CWD and applies it via git am.

- -

EXAMPLES

- -

Pull https://github.com/visionmedia/express/pull/604.

- -
$ cd projects/express
-$ git pull-request 604
-
- -

AUTHOR

- -

Written by TJ Holowaychuk <tj@vision-media.ca>

- -

REPORTING BUGS

- -

<http://github.com/visionmedia/git-extras/issues>

- -

SEE ALSO

- -

<http://github.com/visionmedia/git-extras>

- - -
    -
  1. -
  2. March 2011
  3. -
  4. git-pull-request(1)
  5. -
- -
- - diff --git a/man/git-pull-request.md b/man/git-pull-request.md deleted file mode 100644 index 11f737f..0000000 --- a/man/git-pull-request.md +++ /dev/null @@ -1,29 +0,0 @@ -git-pull-request(1) -- Pulls a github request -==================================== - -## SYNOPSIS - -`git-pull-request` [number] - -## DESCRIPTION - - Pulls the given request number the project in the __CWD__ and applies it via `git am`. - -## EXAMPLES - - Pull https://github.com/visionmedia/express/pull/604. - - $ cd projects/express - $ git pull-request 604 - -## AUTHOR - -Written by TJ Holowaychuk <> - -## REPORTING BUGS - -<> - -## SEE ALSO - -<>