Skip to content

Commit eee1549

Browse files
committed
many-commits 2m
1 parent 260a269 commit eee1549

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

other-test-repos/many-commits.py

+24-13
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,26 @@
77
88
For extra safety, use a tmpfs or ramfs:
99
10-
ulimit -Sv 500000
11-
sudo umount tmp && \
12-
sudo mount -t tmpfs -o size=1g tmpfs tmp && \
13-
sudo chown $USER:$USER tmp &&
14-
./imagine-all-the-people.py
10+
```
11+
ulimit -Sv 500000
12+
mkdir -p tmp
13+
sudo umount tmp
14+
sudo mount -t tmpfs -o size=3g tmpfs tmp
15+
sudo chown $USER:$USER tmp
16+
cd tmp
17+
../many-commits.py
18+
```
1519
1620
The tags can be used to push by parts to GitHub, which does not accept 1M at once:
1721
18-
remote='[email protected]:cirosantilli/test-many-commits-1m.git'
19-
for i in `seq 10 10 100`; do
20-
git --git-dir=tmp/repo.tmp/.git push -f "$remote" "$i:master"
21-
done
22-
# TODO for some reason I needed this afterwards.
23-
git --git-dir=tmp/repo.tmp/.git push "$remote" 'master'
22+
```
23+
remote='[email protected]:cirosantilli/test-many-commits-1m.git'
24+
for i in `seq 10 10 100`; do
25+
git --git-dir=tmp/repo.tmp/.git push -f "$remote" "$i:master"
26+
done
27+
# TODO for some reason I needed this afterwards.
28+
git --git-dir=tmp/repo.tmp/.git push "$remote" 'master'
29+
```
2430
"""
2531

2632
import datetime
@@ -30,11 +36,16 @@
3036

3137
import util
3238

33-
39+
email = b''
3440
name = b''
3541

3642
util.init()
3743

44+
# https://stackoverflow.com/questions/9905257/git-push-fatal-unable-to-create-thread-resource-temporarily-unavailable
45+
subprocess.run(['git', 'config', '--local', 'pack.windowMemory', '50m'])
46+
subprocess.run(['git', 'config', '--local', 'pack.packSizeLimit', '50m'])
47+
subprocess.run(['git', 'config', '--local', 'pack.threads', '1'])
48+
3849
tree = util.create_tree_with_one_file()
3950
commit = None
4051
if len(sys.argv) > 1:
@@ -59,7 +70,7 @@
5970
print(datetime.datetime.now())
6071
# Lose objects are too large and blow up the tmpfs.
6172
# Does clean packets, but the calculation takes more and more memory,
62-
# and slows down and blows up at the end. TODO which subcommand blows up eactly?.
73+
# and slows down and blows up at the end. TODO which subcommand blows up exactly?.
6374
#subprocess.check_output(['git', 'gc'])
6475
subprocess.check_output(['git', 'repack'])
6576
subprocess.check_output(['git', 'prune-packed'])

0 commit comments

Comments
 (0)