Skip to content

Instantly share code, notes, and snippets.

@andizzle
Created March 1, 2013 12:06
Show Gist options
  • Save andizzle/5064226 to your computer and use it in GitHub Desktop.
Save andizzle/5064226 to your computer and use it in GitHub Desktop.
import os
import time
import subprocess
def create_commits(path):
os.chdir(path)
for i in xrange(1, 10):
start = time.clock()
subprocess.call('dd if=/dev/urandom of=testfile_1MB bs=1024 count=1', shell=True)
subprocess.call('cat testfile_1MB >> testfile_500MB', shell=True)
subprocess.call('rm testfile_1MB', shell=True)
subprocess.call('git commit -am"' + str(i) + '"', shell=True)
def checkout(path, commit):
os.chdir(path)
subprocess.call('git reset --hard ' + commit, shell=True)
def main():
create_commits('/Users/andy/Desktop/test1/')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment