www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - GitHub pull requests made easy

reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
The overhead of creating pull requests was getting to me, so I've 
written a little script to make it easier:

https://gist.github.com/1885859

This script does three things:

1) Pushes the current branch to your GitHub fork
2) Sets the default remote for the branch, so that you can just 
type "git push" to update your pull request
3) Opens a web browser on the "Create pull request" form, so that 
you don't have to go to GitHub, navigate to your fork, select the 
new branch, and click the "Pull Request" button.

It will use your GitHub username (if you've set github.user) to 
find the remote name of your fork. Otherwise, just specify the 
name of the remote corresponding to your fork as the first 
parameter.

If you create a git alias, you can type "git pullrequest" to run 
it. To do that, add the line "pullrequest = 
!/path/to/git-pullrequest.sh $*" to the [alias] section of your 
~/.gitconfig.

The script is not specific to D; it will work for any GitHub fork.

Happy contributing!
Feb 22 2012
next sibling parent "Nick Sabalausky" <a a.a> writes:
"Vladimir Panteleev" <vladimir thecybershadow.net> wrote in message 
news:hvwkhrqbzbeeqhewmyed forum.dlang.org...
 The overhead of creating pull requests was getting to me, so I've written 
 a little script to make it easier:

 https://gist.github.com/1885859

 This script does three things:

 1) Pushes the current branch to your GitHub fork
 2) Sets the default remote for the branch, so that you can just type "git 
 push" to update your pull request
 3) Opens a web browser on the "Create pull request" form, so that you 
 don't have to go to GitHub, navigate to your fork, select the new branch, 
 and click the "Pull Request" button.

 It will use your GitHub username (if you've set github.user) to find the 
 remote name of your fork. Otherwise, just specify the name of the remote 
 corresponding to your fork as the first parameter.

 If you create a git alias, you can type "git pullrequest" to run it. To do 
 that, add the line "pullrequest = !/path/to/git-pullrequest.sh $*" to the 
 [alias] section of your ~/.gitconfig.

 The script is not specific to D; it will work for any GitHub fork.

 Happy contributing!
Great idea! This is actually one example though of why I think GitHub/BitBucket-style functionality should be built into DVCSes.
Feb 22 2012
prev sibling next sibling parent reply "David Nadlinger" <see klickverbot.at> writes:
On Wednesday, 22 February 2012 at 16:51:14 UTC, Vladimir 
Panteleev wrote:
 The overhead of creating pull requests was getting to me, so 
 I've written a little script to make it easier:

 https://gist.github.com/1885859
Personally, I use »hub« as a wrapper for Git all the time: https://github.com/defunkt/hub. Among other things (such as GitHub username/fork awareness when cloning/adding remotes, directly cherry-picking from web URLs, …), it also gives you a »git pull-request« command doing exactly what the name suggests. Also, GitHub recently rolled out a pull request creation shortcut on their repository pages: https://github.com/blog/1039-easier-pull-request-creation David
Feb 22 2012
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"David Nadlinger" <see klickverbot.at> wrote in message 
news:ziirmcwpgshvrymgerfe forum.dlang.org...
 On Wednesday, 22 February 2012 at 16:51:14 UTC, Vladimir Panteleev wrote:
 The overhead of creating pull requests was getting to me, so I've written 
 a little script to make it easier:

 https://gist.github.com/1885859
Personally, I use »hub« as a wrapper for Git all the time: https://github.com/defunkt/hub. Among other things (such as GitHub username/fork awareness when cloning/adding remotes, directly cherry-picking from web URLs, .),
Neat. Hopefully it'll add BitBucket support too at some point.
 it also gives you a »git pull-request« command doing exactly what the name 
 suggests.
TortoiseGit also has a built-in Pull Request feature, although I've yet to figure out how to work it.
 Also, GitHub recently rolled out a pull request creation shortcut on their 
 repository pages: 
 https://github.com/blog/1039-easier-pull-request-creation

 David 
Feb 22 2012
parent Brad Anderson <eco gnuk.net> writes:
On Wed, Feb 22, 2012 at 11:20 AM, Nick Sabalausky <a a.a> wrote:

 "David Nadlinger" <see klickverbot.at> wrote in message
 news:ziirmcwpgshvrymgerfe forum.dlang.org...
 On Wednesday, 22 February 2012 at 16:51:14 UTC, Vladimir Panteleev wrot=
e:
 The overhead of creating pull requests was getting to me, so I've
written
 a little script to make it easier:

 https://gist.github.com/1885859
Personally, I use =BBhub=AB as a wrapper for Git all the time: https://github.com/defunkt/hub. Among other things (such as GitHub username/fork awareness when cloning/adding remotes, directly cherry-picking from web URLs, .),
Neat. Hopefully it'll add BitBucket support too at some point.
Defunkt is one of the founders of GitHub so I wouldn't wait around for it. Regards, Brad Anderson
 it also gives you a =BBgit pull-request=AB command doing exactly what t=
he
 name
 suggests.
TortoiseGit also has a built-in Pull Request feature, although I've yet t=
o
 figure out how to work it.

 Also, GitHub recently rolled out a pull request creation shortcut on
their
 repository pages:
 https://github.com/blog/1039-easier-pull-request-creation

 David
Feb 22 2012
prev sibling parent "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Wednesday, 22 February 2012 at 18:10:24 UTC, David Nadlinger 
wrote:
 On Wednesday, 22 February 2012 at 16:51:14 UTC, Vladimir 
 Panteleev wrote:
 The overhead of creating pull requests was getting to me, so 
 I've written a little script to make it easier:

 https://gist.github.com/1885859
Personally, I use »hub« as a wrapper for Git all the time: https://github.com/defunkt/hub. Among other things (such as GitHub username/fork awareness when cloning/adding remotes, directly cherry-picking from web URLs, …), it also gives you a »git pull-request« command doing exactly what the name suggests.
Not bad, does it work on Windows? I don't like that it opens an editor for writing the pull request details. Being able to review your markdown formatting / diff / commits on the website is useful.
 Also, GitHub recently rolled out a pull request creation 
 shortcut on their repository pages: 
 https://github.com/blog/1039-easier-pull-request-creation
One step less, three remain :P
Feb 22 2012
prev sibling parent Brad Roberts <braddr puremagic.com> writes:
On 2/22/2012 8:51 AM, Vladimir Panteleev wrote:
 The overhead of creating pull requests was getting to me, so I've written a
little script to make it easier:
 
 https://gist.github.com/1885859
 
 This script does three things:
 
 1) Pushes the current branch to your GitHub fork
 2) Sets the default remote for the branch, so that you can just type "git
push" to update your pull request
 3) Opens a web browser on the "Create pull request" form, so that you don't
have to go to GitHub, navigate to your fork,
 select the new branch, and click the "Pull Request" button.
 
 It will use your GitHub username (if you've set github.user) to find the
remote name of your fork. Otherwise, just
 specify the name of the remote corresponding to your fork as the first
parameter.
 
 If you create a git alias, you can type "git pullrequest" to run it. To do
that, add the line "pullrequest =
 !/path/to/git-pullrequest.sh $*" to the [alias] section of your ~/.gitconfig.
 
 The script is not specific to D; it will work for any GitHub fork.
 
 Happy contributing!
You could avoid the web ui interaction and just use the github api's. See: https://developer.github.com/
Feb 22 2012