public
Description: A set of Sake tasks to make developing with Git easier.
Clone URL: git://github.com/eventualbuddha/sake-git.git
Search Repo:
Add git:ify task. Easily convert a Subversion repo into a Git repo.
cypher (author)
Thu Mar 06 03:19:19 -0800 2008
commit  5fec850341714e67ea87658a0d079885cbd10264
tree    540cda51b513edb4ab442138b57d30b0b302f779
parent  21d07c6dd8a8af06680306f51454f1798f18fbf2
...
202
203
204
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
0
@@ -202,3 +202,19 @@ task 'git:update:all' => [ 'git:helpers' ] do
0
     `git-checkout #{branch} 2>/dev/null` if switch
0
   end
0
 end
0
+
0
+desc 'Converts an existing Subversion Repo into a Git Repository'
0
+task 'git:ify' do
0
+ # Make sure we're in an svn repo
0
+ raise "This task can only be executed in an existing working copy! (No .svn-Folder found)" unless File.exists?("./.svn") && File.directory?("./.svn")
0
+
0
+ # get svn info location
0
+ svnurl = `svn info | grep "^URL:"`.gsub('URL: ','').chomp
0
+
0
+ # project = basename
0
+ project = "../#{File.basename(Dir.pwd)}.git"
0
+
0
+ puts cmd = "git svn clone #{svnurl} #{project}"
0
+
0
+ `#{cmd}`
0
+end

Comments

    No one has commented yet.