Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Nerian/github_subversion_converter
base: master
...
head fork: subtleGradient/github_subversion_converter
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
32 README.md
@@ -1,18 +1,18 @@
GitHub Subversion Converter – GitSC
-====================================
+====================================
GitSC has nothing to do with StarCraft. GitSC is a ruby command line script that will allow you to transfer the commits from a GitHub SVN repo to a real repo anywhere.
-It really can transfer commits from SVN repos hosted anywhere, but GitSC is optimised to deal with GitHub SVN little nuances.
+It really can transfer commits from SVN repos hosted anywhere, but GitSC is optimised to deal with GitHub SVN little nuances.
It can keep transferring commits from origin to destiny after the initial transfer. It just pick where it left.
-What GitSC does is to commit changes one by one from the origin to destiny. In such process it performs some validations to deal with GitHub SVN little nuances, namely Phantom commits ( I created a fancy word, yeah! ^_^ ). So it is VERY slow. Transferring 50 commits can take 5 min.
+What GitSC does is to commit changes one by one from the origin to destiny. In such process it performs some validations to deal with GitHub SVN little nuances, namely Phantom commits ( I created a fancy word, yeah! ^_^ ). So it is VERY slow. Transferring 50 commits can take 5 min.
A Phantom commit happens when the previous commit is exactly the same as the commit we are trying to commit. SVN won't allow such a commit so it won't never happen on a real SVN server. But as I said, GitHub does a little magic behind the scene and it removes the .gitignore files. Many times you just make a commit whose only change was the .gitignore file. In such case, you have a phantom commit in svn fake repo. GitCS it is capable of dealing with this, rest assured.
-So if you just want to clone real SVN repos, not hosted at GitHub, I recommend you to check [svnsync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html SVNSYNC).
-
+So if you just want to clone real SVN repos, not hosted at GitHub, I recommend you to check [svnsync](http://svnbook.red-bean.com/en/1.5/svn.ref.svnsync.html SVNSYNC).
+
Current Status
====================================
@@ -22,12 +22,12 @@ Current Status
* Make commits retain the commit message | it's done!
* Create command line tool so GitSC can be used | it's done!
* Think on how to deal with user names and passwords | on it!
-* Integrate with Hoe to make automatic Gem | on it!
-
+* Integrate with Hoe to make automatic Gem | on it!
+
-* Make commits have the right date it is not done.
+* Make commits have the right date it is not done.
-The last feature requires modifying hooks script on the server side, which sucks and I don't really need it. So chances are that I won't add this feature. Feel free to fork the project and do it yourself, I will accept a pull request.
+The last feature requires modifying hooks script on the server side, which sucks and I don't really need it. So chances are that I won't add this feature. Feel free to fork the project and do it yourself, I will accept a pull request.
The line you have to touch in on the method "perform\_conversion\_operations" inside "lib/conversor.rb". The last lines of that method call the method "update\_destiny\_server\_commit\_date\_to\_origin\_commit\_date()". You just have to implement that.
@@ -38,27 +38,25 @@ Currently I just have the ruby class and cucumber tests. So it is not ready for
But the expected way of using is:
- GitSC --origin *address* --destiny *address*
-
-Take note, if two persons do this a the same time you could end with many duplicated commits. So I recommend that if you are working with other people your team designate just one person to do it.
+ GitSC --origin *address* --destiny *address*
+
+Take note, if two persons do this a the same time you could end with many duplicated commits. So I recommend that if you are working with other people your team designate just one person to do it.
+
-
Why are you doing this?
====================================
-GitSC was born to fill a need. I had a couple of projects at school and it was mandatory to host the project at the faculty SVN servers. But I didn't want to use such useless version control system. I am a branch consuming addict. I can't live without superb branch support. SVN just doesn't give me that.
+GitSC was born to fill a need. I had a couple of projects at school and it was mandatory to host the project at the faculty SVN servers. But I didn't want to use such useless version control system. I am a branch consuming addict. I can't live without superb branch support. SVN just doesn't give me that.
At the same time I was learning ruby and reading Pragmatic Programmers's Behaviour Driven Development with Cucumber and RSpec. So it was the perfect occasion to apply the concepts. As I was developing this, I added a new trait to my personality. I am a test addict. Now I can't live without heavy testing :)
-
+
Do you need help?
===================================
Yes! The application needs to be able to deal with very different scenarios. So Tests are very much welcomed. Also, I am not a Ruby expert – give time – so any kind of code review would be very much appreciate.
Thank you for your time.
-
-
View
26 features/step_definitions/steps_def.feature.rb
@@ -12,32 +12,32 @@ def output
@output ||= Output.new
end
-Given /^we initiate the conversor with origin "([^"]*)" and destiny "([^"]*)"$/ do |origin, destiny|
- @conversor = Conversor::Conversor.new(output, origin, destiny)
+Given /^we initiate the conversor with origin "([^\"]*)" and destiny "([^\"]*)"$/ do |origin, destiny|
+ @conversor = Conversor::Conversor.new(output, origin, destiny)
end
When /^I checkout destiny repo$/ do
@conversor.checkout_destiny_repo()
-end
+end
-Given /^the SVN Origin Repo is "([^"]*)"$/ do |svn_address_origin|
+Given /^the SVN Origin Repo is "([^\"]*)"$/ do |svn_address_origin|
@conversor.svn_address_origin = svn_address_origin
end
-Given /^the SVN destiny Repo is "([^"]*)"$/ do |svn_address_destiny|
+Given /^the SVN destiny Repo is "([^\"]*)"$/ do |svn_address_destiny|
@conversor.svn_address_destiny = svn_address_destiny
end
When /^I checkout origin repo$/ do
- @conversor.checkout_origin_repo()
-end
-
-Given /^there are some SVN repos like "([^"]*)"$/ do |name|
+ @conversor.checkout_origin_repo()
+end
+
+Given /^there are some SVN repos like "([^\"]*)"$/ do |name|
if not File.exist?("/tmp/Server_Repos")
- system("mkdir /tmp/Server_Repos")
+ system("mkdir /tmp/Server_Repos")
end
system("rm -Rf /tmp/Server_Repos/"+name)
- system("svnadmin create /tmp/Server_Repos/"+name)
+ system("svnadmin create /tmp/Server_Repos/"+name)
end
When /^I perform de conversion process$/ do
@@ -45,10 +45,10 @@ def output
end
Then /^both repos should have the same revision$/ do
- @conversor.destiny_repo_online_revision.should == @conversor.final_revision_that_you_want_to_mirror
+ @conversor.destiny_repo_online_revision.should == @conversor.final_revision_that_you_want_to_mirror
end
-Then /^I should see a message "([^"]*)"$/ do |message|
+Then /^I should see a message "([^\"]*)"$/ do |message|
result = File.exist?("/tmp/Server_Repos/"+@conversor.svn_origin_name)
if result
output.puts (message)
View
2  lib/conversor.rb
@@ -11,7 +11,7 @@ class Conversor
# svn_destiny_name is the name of the checkout destiny repo.
attr_accessor :output, :svn_address_origin, :svn_address_destiny, :svn_origin_name, :svn_destiny_name, :final_revision_that_you_want_to_mirror, :log_file_of_origin
- def initialize(output=STDOUT, svn_address_origin, svn_address_destiny)
+ def initialize(output=STDOUT, svn_address_origin=nil, svn_address_destiny=nil)
@output = output
@svn_origin_name = "origin" #Just the name, not the file path.
@svn_destiny_name = "destiny" #Just the name, not the file path.

No commit comments for this range

Something went wrong with that request. Please try again.