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
parent "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
prev sibling next 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
prev sibling next 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 Anderson <eco gnuk.net> writes:
--bcaec554dbba16da0604b991fbfa
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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=


 The overhead of creating pull requests was getting to me, so I've


 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.

Regards, Brad Anderson
 it also gives you a =BBgit pull-request=AB command doing exactly what t=


 name
 suggests.

TortoiseGit also has a built-in Pull Request feature, although I've yet t=

 figure out how to work it.

 Also, GitHub recently rolled out a pull request creation shortcut on

 repository pages:
 https://github.com/blog/1039-easier-pull-request-creation

 David


--bcaec554dbba16da0604b991fbfa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Feb 22, 2012 at 11:20 AM, Nick Sabalausky <span dir=3D"ltr">&lt;a a= .a&gt;</span> wrote:<br><div class=3D"gmail_quote"><blockquote class=3D"gma= il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef= t:1ex"> &quot;David Nadlinger&quot; &lt;<a href=3D"mailto:see klickverbot.at">see k= lickverbot.at</a>&gt; wrote in message<br> news:ziirmcwpgshvrymgerfe forum.dlang.org...<br> <div class=3D"im">&gt; On Wednesday, 22 February 2012 at 16:51:14 UTC, Vlad= imir Panteleev wrote:<br> &gt;&gt; The overhead of creating pull requests was getting to me, so I&#39= ;ve written<br> &gt;&gt; a little script to make it easier:<br> &gt;&gt;<br> &gt;&gt; <a href=3D"https://gist.github.com/1885859" target=3D"_blank">http= s://gist.github.com/1885859</a><br> &gt;<br> &gt; Personally, I use =BBhub=AB as a wrapper for Git all the time:<br> &gt; <a href=3D"https://github.com/defunkt/hub" target=3D"_blank">https://g= ithub.com/defunkt/hub</a>. Among other things (such as GitHub<br> &gt; username/fork awareness when cloning/adding remotes, directly<br> </div>&gt; cherry-picking from web URLs, .),<br> <br> Neat. Hopefully it&#39;ll add BitBucket support too at some point.<br> <div class=3D"im"><br></div></blockquote><div><br></div><div>Defunkt is one= of the founders of GitHub so I wouldn&#39;t wait around for it.</div><div>= <br></div><div>Regards,</div><div>Brad Anderson</div><div>=A0</div><blockqu= ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s= olid;padding-left:1ex"> <div class=3D"im"> &gt; it also gives you a =BBgit pull-request=AB command doing exactly what = the name<br> &gt; suggests.<br> &gt;<br> <br> </div>TortoiseGit also has a built-in Pull Request feature, although I&#39;= ve yet to<br> figure out how to work it.<br> <div class=3D"HOEnZb"><div class=3D"h5"><br> &gt; Also, GitHub recently rolled out a pull request creation shortcut on t= heir<br> &gt; repository pages:<br> &gt; <a href=3D"https://github.com/blog/1039-easier-pull-request-creation" = target=3D"_blank">https://github.com/blog/1039-easier-pull-request-creation= </a><br> &gt;<br> &gt; David<br> <br> <br> </div></div></blockquote></div><br> --bcaec554dbba16da0604b991fbfa--
Feb 22 2012