Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .gitconfig
- [github]
- user = your-username
- password = your-password
- [alias]
- # git pullrequest branch-name "title line" "description blah blah"
- pullrequest = !sh -c 'curl -s -u "`git config --get github.user`:`git config --get github.password`" https://api.github.com/repos/`git remote show -n origin | head -n 2 | grep -o github.com[^.]* | cut -b 12-`/pulls -d "\\{\\\"title\\\":\\\"$2\\\",\\\"body\\\":\\\"$3\\\",\\\"head\\\":\\\"$1\\\",\\\"base\\\":\\\"master\\\"\\}"' -
- ----
- breaking it down:
- sh -c '' -
- run a shell, reading parameters passed in
- git config --get github.x
- get git config variable
- git remote show -n origin | head -n 2 | grep -o github.com[^.]* | cut -b 12-
- a very hacky way to get the api path for the repository
- surely there is a better way?
- "\\{\\\"title\\\":\\\"$2\\\",\\\"body\\\":\\\"$3\\\",\\\"head\\\":\\\"$1\\\",\\\"base\\\":\\\"master\\\"\\}"
- the json string. i can't think of any way to make the leaning toothpicks (via @vhata) dissappear?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement