Created
July 23, 2014 12:17
-
-
Save tef/7f458c4a24928c8a909a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from datetime import datetime, timedelta | |
from subprocess import check_output, check_call as spawn | |
def make_dates(): | |
start = datetime(2013,3,3,12,00,00) | |
reps = 1 | |
for x in range(365*8): | |
for n in range(reps): | |
date = start + timedelta(days=x, minutes=n) | |
yield date | |
if (x+1) % 35 == 0: | |
reps +=1 | |
print "At Day",x, "Reps now", reps | |
def make_repo(name, dates): | |
spawn(["mkdir","-p",name]) | |
os.chdir(name) | |
spawn(["/usr/local/git/bin/git","init"]) | |
for date in dates: | |
commit(date) | |
def commit(date): | |
date = date.isoformat()+"Z" | |
env = dict(os.environ) | |
env['GIT_AUTHOR_DATE'] = date | |
env['GIT_COMMITTER_DATE'] = date | |
spawn([ | |
"/usr/local/git/bin/git", | |
"commit", | |
"--allow-empty", | |
"--allow-empty-message", | |
"-qam", | |
"" | |
],env=env) | |
if __name__ == '__main__': | |
make_repo(sys.argv[1], make_dates()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment