-
-
Save jsocol/452299 to your computer and use it in GitHub Desktop.
Revisions
-
jsocol revised this gist
Jun 25, 2010 . 1 changed file with 27 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,15 +3,40 @@ # usage: git req username [comparetobranch] # or: git req username -m 'message' # put somewhere in your PATH as git-req and make executable usage() { cat << EOF usage: $0 options Sends a pull request via github OPTIONS: -h Show this message -f Force a pull request EOF } FORCE= while getopts "hf" OPTION do case $OPTION in h) usage; exit;; f) FORCE=1;; esac done shift $(($OPTIND - 1)) GITUNCOMMITTED=$(git status | sed -n 2p) && GITUNCOMMITTED=${GITUNCOMMITTED:0:7} if [ "$GITUNCOMMITTED" != 'nothing' -a -z "$FORCE" ] then echo -ne 'Error: Woah, woah, woah. There are uncommitted changes!\n' exit $? fi GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUNPUSHED=$(git log origin/$GITBRANCH..$GITBRANCH --pretty=oneline --abbrev-commit) if [ "$GITUNPUSHED" != '' -a -z "$FORCE" ] then echo -ne 'Error: Push your changes!\n' exit $? -
endtwist revised this gist
May 27, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ then exit $? fi GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUNPUSHED=$(git log origin/$GITBRANCH..$GITBRANCH --pretty=oneline --abbrev-commit) if [ "$GITUNPUSHED" != '' ] then echo -ne 'Error: Push your changes!\n' -
endtwist revised this gist
May 27, 2010 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,19 @@ # usage: git req username [comparetobranch] # or: git req username -m 'message' # put somewhere in your PATH as git-req and make executable GITUNCOMMITTED=$(git status | sed -n 2p) && GITUNCOMMITTED=${GITUNCOMMITTED:0:7} if [ "$GITUNCOMMITTED" != 'nothing' ] then echo -ne 'Error: Woah, woah, woah. There are uncommitted changes!\n' exit $? fi GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUNPUSHED=$(git log origin/568310-search-metrics..568310-search-metrics --pretty=oneline --abbrev-commit) if [ "$GITUNPUSHED" != '' ] then echo -ne 'Error: Push your changes!\n' exit $? fi GITUSER=$(git config github.user) GITPROJECT=$(grep 'url =' .git/config | sed -n 1p | sed -e 's/.*url = [email protected]:'$GITUSER'.*[/]\(.*\).git$/\1/') GITTOKEN=$(git config github.token) -
endtwist revised this gist
May 27, 2010 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,9 @@ # or: git req username -m 'message' # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUSER=$(git config github.user) GITPROJECT=$(grep 'url =' .git/config | sed -n 1p | sed -e 's/.*url = [email protected]:'$GITUSER'.*[/]\(.*\).git$/\1/') GITTOKEN=$(git config github.token) if [ $(echo "${#2}") != '0' ] then if [ "$2" != '-m' ] -
endtwist revised this gist
May 27, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/bin/bash # allows you to send pull requests from the command line # usage: git req username [comparetobranch] # or: git req username -m 'message' # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') -
endtwist revised this gist
May 27, 2010 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,24 @@ #!/bin/bash # allows you to send pull requests from the command line # usage: git req username [comparetobranch] # or: git req username -m [message] # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITPROJECT=$(grep 'url =' .git/config | sed -n 1p | sed -e 's/.*url = [email protected]:'$GITUSER'.*[/]\(.*\).git$/\1/') GITTOKEN=$(grep 'token =' ~/.gitconfig | sed -e 's/.*token = \(.*\)/\1/') if [ $(echo "${#2}") != '0' ] then if [ "$2" != '-m' ] then GITCOMPR="http://github.com/$GITUSER/$GITPROJECT/compare/$2...$GITBRANCH" else GITCOMPR=$3 fi else GITCOMPR='' fi GITPULLREQ=$(curl -Flogin=$GITUSER -Ftoken=$GITTOKEN -Fmessage[to][]=$1 -Fmessage[body]="$GITCOMPR" "http://github.com/$GITUSER/$GITPROJECT/pull_request/$GITBRANCH" 2> /dev/null | sed -e 's/.*You are.*/OK/') if [ $GITPULLREQ != 'OK' ] then echo -ne 'Could not complete pull request.\n' -
endtwist revised this gist
May 27, 2010 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,6 @@ # allows you to send pull requests from the command line # usage: git req username [comparetobranch] # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITPROJECT=$(grep 'url =' .git/config | sed -n 1p | sed -e 's/.*url = [email protected]:'$GITUSER'.*[/]\(.*\).git$/\1/') -
endtwist revised this gist
May 27, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash # allows you to send pull requests from the command line # usage: git req username [comparetobranch] # put somewhere in your PATH as git-req and make executable #!/bin/bash #!/bin/bash -
endtwist revised this gist
May 27, 2010 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,18 @@ # usage: git req username # put somewhere in your PATH as git-req and make executable #!/bin/bash #!/bin/bash GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITPROJECT=$(grep 'url =' .git/config | sed -n 1p | sed -e 's/.*url = [email protected]:'$GITUSER'.*[/]\(.*\).git$/\1/') GITTOKEN=$(grep 'token =' ~/.gitconfig | sed -e 's/.*token = \(.*\)/\1/') if [ $(echo "${#2}") != '0' ] then GITCOMPR="-Fmessage[body]=http://github.com/$GITUSER/$GITPROJECT/compare/$2...$GITBRANCH " else GITCOMPR='' fi GITPULLREQ=$(curl -Flogin=$GITUSER -Ftoken=$GITTOKEN -Fmessage[to][]=$1 $GITCOMPR"http://github.com/$GITUSER/$GITPROJECT/pull_request/$GITBRANCH" 2> /dev/null | sed -e 's/.*You are.*/OK/') if [ $GITPULLREQ != 'OK' ] then echo -ne 'Could not complete pull request.\n' -
endtwist revised this gist
May 27, 2010 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,13 +2,15 @@ # allows you to send pull requests from the command line # usage: git req username # put somewhere in your PATH as git-req and make executable #!/bin/bash GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITPROJECT=$(grep 'url =' .git/config | sed -n 1p | sed -e 's/.*url = [email protected]:'$GITUSER'.*[/]\(.*\).git$/\1/') GITTOKEN=$(grep 'token =' ~/.gitconfig | sed -e 's/.*token = \(.*\)/\1/') GITPULLREQ=$(curl -Flogin=$GITUSER -Ftoken=$GITTOKEN -Fmessage[to][]=$1 "http://github.com/$GITUSER/$GITPROJECT/pull_request/$GITBRANCH" 2> /dev/null | sed -e 's/.*You are.*/OK/') if [ $GITPULLREQ != 'OK' ] then echo -ne 'Could not complete pull request.\n' else echo -ne 'Pull request sent to '$1'.\n' fi -
endtwist revised this gist
May 27, 2010 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ #!/bin/bash # allows you to send pull requests from the command line # usage: git req username # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITPROJECT=$(grep 'url =' .git/config | sed -e 's/.*url = [email protected]:$1.*[/]\(.*\).git$/\1/') GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITTOKEN=$(grep 'token =' ~/.gitconfig | sed -e 's/.*token = \(.*\)/\1/') GITPULLREQ=$(curl -Flogin=$GITUSER -Ftoken=$GITTOKEN -Fmessage[to][]=$1 "http://github.com/$GITUSER/$GITPROJECT/pull_request/$GITBRANCH" 2> /dev/null | sed -e 's/.*You are.*/OK/') if [ $GITPULLREQ != 'OK' ]; then echo -ne 'Could not complete pull request.\n' else echo -ne 'Pull request sent to '$1'.\n' fi -
endtwist revised this gist
May 27, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # allows pull requests from the command line # usage: git req repo username # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git symbolic-ref HEAD | cut -d/ -f3) GITPROJECT=$(grep -A3 'remote "'$1'"' .git/config | grep 'url =' | sed -e 's/.*url = [email protected]:.*[/]\(.*\).git$/\1/') GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITTOKEN=$(grep 'token =' ~/.gitconfig | sed -e 's/.*token = \(.*\)/\1/') -
endtwist revised this gist
May 27, 2010 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ #!/bin/bash # allows pull requests from the command line # usage: git req repo username # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') -
endtwist revised this gist
May 27, 2010 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
Empty file. -
There are no files selected for viewing
Empty file.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/bash # usage: git req repo username # put somewhere in your PATH as git-req and make executable GITBRANCH=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') GITPROJECT=$(grep -A3 'remote "'$1'"' .git/config | grep 'url =' | sed -e 's/.*url = [email protected]:.*[/]\(.*\).git$/\1/') GITUSER=$(grep 'user =' ~/.gitconfig | sed -e 's/.*user = \(.*\)/\1/') GITTOKEN=$(grep 'token =' ~/.gitconfig | sed -e 's/.*token = \(.*\)/\1/') GITPULLREQ=$(curl -Flogin=$GITUSER -Ftoken=$GITTOKEN -Fmessage[to][]=$2 "http://github.com/$GITUSER/$GITPROJECT/pull_request/$GITBRANCH" 2> /dev/null | sed -e 's/.*You are.*/OK/') if [ $GITPULLREQ != 'OK' ]; then echo -ne '['$1'] Could not complete pull request.\n' else echo -ne '['$1'] Pull request sent to '$2'.\n' fi