30
Sep
11

git svn fetch on windows



For some reason, my git svn fetch only brings a few revisions before stopping. So, I wrote a script to continue fetching until the string for a certain revision hasn’t been seen:


limit = "rXXXX" # pull until you see this string somewhere
stop = false
pull_number = 0
process = nil

trap("SIGINT") do 
  puts "Interrupt requested"
  stop = true
  Process.kill("KILL",process.pid) if process
end


loop do
	pull_number += 1
	break if stop
	process = IO.popen("git svn fetch")
	puts "pull number #{pull_number}"
	
	process.each_line do |line|
		puts line
		if line=~/#{limit}/i
			stop = true
		end
	end	
end

Advertisements

0 Responses to “git svn fetch on windows”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 228,119 hits

%d bloggers like this: