Skip to content

Commit

Permalink
many-commits-octopus
Browse files Browse the repository at this point in the history
  • Loading branch information
cirosantilli committed Sep 4, 2018
1 parent 9443128 commit 9374e5e
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions other-test-repos/many-commits-octopus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3

import datetime
import subprocess
import time
import sys

import util

email = b'[email protected]'
name = b''

util.init()

tree = util.create_tree_with_one_file()
commit = None
if len(sys.argv) > 1:
n = int(sys.argv[1])
else:
n = 1000
base_commit, _, _ = util.save_commit_object(
tree,
(commit,),
author_date_s=0,
author_email=email,
author_name=name,
committer_date_s=0,
committer_email=email,
committer_name=name,
message=b'',
)
parents = []
for i in range(n):
now = int(time.time())
commit, _, _ = util.save_commit_object(
tree,
(base_commit,),
author_date_s=i,
author_email=email,
author_name=name,
committer_date_s=0,
committer_email=email,
committer_name=name,
message=b'',
)
parents.append(commit)
if i % 100000 == 0:
print(i)
print(datetime.datetime.now())
subprocess.check_output(['git', 'repack'])
subprocess.check_output(['git', 'prune-packed'])
subprocess.check_output(['git', 'tag', str(i), commit])
final_commit, _, _ = util.save_commit_object(
tree,
parents,
author_date_s=0,
author_email=email,
author_name=name,
committer_date_s=0,
committer_email=email,
committer_name=name,
message=b'',
)
util.create_master(final_commit)

0 comments on commit 9374e5e

Please sign in to comment.