-
-
Save tinogis/5669515 to your computer and use it in GitHub Desktop.
This file contains 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 characters
#!/bin/bash | |
d_repo=( $(git remote -v | grep '\(push\)' | cut -d':' -f 2 | \ | |
cut -d' ' -f 1 | cut -d '.' -f 1) ) | |
d_base="developer" | |
d_from=gisce:$(git branch --no-color 2> /dev/null | grep '^\*' | \ | |
cut -d ' ' -f 2) | |
read -p "User:" user | |
read -sp "Password:" password | |
echo | |
if [ ${#d_repo[@]} -gt 1 ] ; | |
then | |
echo "Available repos: '${d_repo[*]}' " | |
fi | |
read -p "Dest repo (${d_repo[0]}): " repo | |
if [ "x" == "x$repo" ]; then repo=$d_repo; fi | |
read -p "Dest branch ($d_base): " base | |
if [ "x" == "x$base" ]; then base=$d_base; fi | |
read -p "From branch ($d_from): " from | |
if [ "x" == "x$from" ]; then from=$d_from; fi | |
read -p "Issue:" issue | |
http -a $user:$password -j POST https://api.github.com/repos/$repo/pulls \ | |
base=$base head=$from issue=$issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment