Skip to content

Commit

Permalink
Greatly improved speed
Browse files Browse the repository at this point in the history
"python greenhat.py 365" now takes under a minute instead of 8 hours
  • Loading branch information
Dakkaron committed May 24, 2016
1 parent d736caf commit 061a010
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions greenhat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from datetime import date, timedelta
from random import randint
from time import sleep
import sys
import subprocess
import os
Expand All @@ -29,8 +28,7 @@ def main(argv):
curdate = get_date_string(i, startdate)
num_commits = randint(1, 10)
for commit in range(0, num_commits):
subprocess.call("echo '" + curdate + str(randint(0, 1000000)) +"' > realwork.txt; git add realwork.txt; GIT_AUTHOR_DATE='" + curdate + "' GIT_COMMITTER_DATE='" + curdate + "' git commit -m 'update'; git push;", shell=True)
sleep(.5)
subprocess.call("echo '" + curdate + str(randint(0, 1000000)) +"' > realwork.txt; sync; git add realwork.txt; GIT_AUTHOR_DATE='" + curdate + "' GIT_COMMITTER_DATE='" + curdate + "' git commit -m 'update'", shell=True)
i += 1
subprocess.call("git rm realwork.txt; git commit -m 'delete'; git push;", shell=True)

Expand Down

1 comment on commit 061a010

@jbushmaster007
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great

Please sign in to comment.