github migration

Lukas Krejci lkrejci at redhat.com
Wed Feb 20 22:45:11 UTC 2013


By far the easiest approach I found is to add this to your .git/config to the [remote "origin"] section (or whatever section corresponds to the remote pointing to github):

fetch = +refs/pull/*/head:refs/remotes/origin/pull/*


This will cause the pull requests to automatically appear as remote branches (and they also get appropriately updated when stuff gets added to the pull request). So when you do git fetch or git pull from the mainline repo, you'll see stuff like:

>From github.com:metlos/RHQ
   6151efc..f1141ed  refs/pull/7/head -> origin/pull/7
(which is when someone pushed a new commit to an existing pull request, etc).

You can then easily check that out locally and merge it the same way we're used to.

The only thing left then is to close the pull request itself. This can be done through the web UI, or you can go to http://metlos.github.com/hub/, follow the simple instructions and once you have that script you can close the pull request with:

hub pull-request -c <pull-request-number> "Comment for closing it"

The ability to close a pull request from the commandline is something I added to generally cool tool called hub (https://github.com/defunkt/hub, or my fork https://github.com/metlos/hub) but it is actually not needed for that. The comment and closing of a pull request is done by calling github's REST API and you could write a script of your own for that easily (or even, god forbid, use the web UI for that ;) ) I decided to update that tool because it nicely solves the OAuth2 authentication with github and other "infrastructural" things I couldn't be bothered dealing with.


So a "fetch + rebase" of a pull request (with number "x") would look like:

git fetch
git checkout -t -b pull-x origin/pull/x
git rebase master
git checkout master
git merge pull-x
git push
hub pull-request -c x "Merged it."
git branch -D pull-x

which is remarkably similar to how we do stuff today when merging the feature branches, the only new stuff being the closing of the pull request.

----- Original Message -----
> From: "Lukas Krejci" <lkrejci at redhat.com>
> To: rhq-devel at lists.fedorahosted.org
> Sent: Wednesday, February 20, 2013 2:50:32 PM
> Subject: Re: github migration
> 
> On Wednesday, February 20, 2013 13:47:42 Heiko W.Rupp wrote:
> > Lukas,
> > 
> > that pretty much nails it
> > 
> > And yes we will wait until 4.6 is out of the door.
> > 
> > My proposal for now is 3 repos:
> > 
> > - core        everything excluding (helpers and plugins), including
> > the
> > platform plugin
> > - plugins  all plugins except the platform plugin, which
> > stays in core
> > - helpers  the helpers module except for the rtfilter*
> 
> +1 I think this is the right balance for now.
> 
> > 
> > We publish the 4.6 artifacts and all plugins/helpers will require
> > the 4.6
> > stable artifacts artifacts will then be 4.7-snapshot
> > 
> > Pull-requests can as you wrote not only be merged via that button
> > in the
> > GitHub UI, but via manual fetch + rebase - which we should try to
> > do.
> 
> I will play with that...
> 
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> 


More information about the rhq-devel mailing list