File tree Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Expand file tree Collapse file tree 1 file changed +64
-0
lines changed Original file line number Diff line number Diff line change
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 )
You can’t perform that action at this time.
0 commit comments