CommitterHowto

Urabe, Shyouhei edited this page Dec 18, 2017 · 1 revision

Ruby committer's happy hacking life with github

Cloning the repo

Using prepared tarball (recommended now)

Preparations explained below using git svn fetch takes hours or days, depending on your network location. It had been a pain for newbe committers. Thanks to @hsbt we now have a prepared git tarball here:

Just download the tarball and expand to somewhere you want. That's all.

Directly from github

% git clone git://github.com/ruby/ruby.git
% cd ruby
% git svn init -s --prefix=origin/ svn+ssh://svn@ci.ruby-lang.org/ruby
% git svn fetch

This might take quite a while (YMMV(Your Mileage May Vary)). Take a cup of coffee. Or three.

After that, your repository behaves as if you converted ci-repository directly into git.

Or, if you need to commit only to trunk, you can replace the @git svn init@ line above by % git svn init --prefix=origin/ -Ttrunk svn+ssh://svn@ci.ruby-lang.org/ruby which will be a lot quicker.

Create a branch.

First take a look at

% git branch -r

and you will see many branches under origin/*. Of particular interest are origin/trunk (head of Ruby) and origin/ruby_2_4 (head of Ruby 2.4). Choose the appropriate branch for your hack and make a local branch from that:

% git checkout -b my_feature origin/trunk

Here I chose origin/trunk for my feature's upstream branch.

Enjoy your happy time.

You can use git normally, including creating other branches, merging, etc... You are a committer so I do not explain this stage since you probably know how.

Push your changes into upstream repository.

Once you are sure you should apply your changes worldwide, begin with:

% git svn rebase

This will bring your branch up to date with the upstream svn repository and rebase your changes. After fixing any conflicts you may commit your changes with:

% git svn dcommit

The changes are now in the official svn repository!

You can notice with git log that git svn has appended to your commits a line with a "git-svn-id" that shows the svn revision number.

Another hack

Now go back to hacking. Enjoy!

Notes: deleting your local branch

Your local branch may be deleted after you have merged it into upstream repository. But you should not be on that branch when you delete that.

% git checkout trunk
% git branch -d my_feature

Appendix

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.