Skip to content

Commit 9374e5e

Browse files
committed
many-commits-octopus
1 parent 9443128 commit 9374e5e

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env python3
2+
3+
import datetime
4+
import subprocess
5+
import time
6+
import sys
7+
8+
import util
9+
10+
email = b'a@a.com'
11+
name = b''
12+
13+
util.init()
14+
15+
tree = util.create_tree_with_one_file()
16+
commit = None
17+
if len(sys.argv) > 1:
18+
n = int(sys.argv[1])
19+
else:
20+
n = 1000
21+
base_commit, _, _ = util.save_commit_object(
22+
tree,
23+
(commit,),
24+
author_date_s=0,
25+
author_email=email,
26+
author_name=name,
27+
committer_date_s=0,
28+
committer_email=email,
29+
committer_name=name,
30+
message=b'',
31+
)
32+
parents = []
33+
for i in range(n):
34+
now = int(time.time())
35+
commit, _, _ = util.save_commit_object(
36+
tree,
37+
(base_commit,),
38+
author_date_s=i,
39+
author_email=email,
40+
author_name=name,
41+
committer_date_s=0,
42+
committer_email=email,
43+
committer_name=name,
44+
message=b'',
45+
)
46+
parents.append(commit)
47+
if i % 100000 == 0:
48+
print(i)
49+
print(datetime.datetime.now())
50+
subprocess.check_output(['git', 'repack'])
51+
subprocess.check_output(['git', 'prune-packed'])
52+
subprocess.check_output(['git', 'tag', str(i), commit])
53+
final_commit, _, _ = util.save_commit_object(
54+
tree,
55+
parents,
56+
author_date_s=0,
57+
author_email=email,
58+
author_name=name,
59+
committer_date_s=0,
60+
committer_email=email,
61+
committer_name=name,
62+
message=b'',
63+
)
64+
util.create_master(final_commit)

0 commit comments

Comments
 (0)