Skip to content

Commit

Permalink
many-commits 2m
Browse files Browse the repository at this point in the history
  • Loading branch information
cirosantilli committed Oct 1, 2020
1 parent 260a269 commit eee1549
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions other-test-repos/many-commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,26 @@
For extra safety, use a tmpfs or ramfs:
ulimit -Sv 500000
sudo umount tmp && \
sudo mount -t tmpfs -o size=1g tmpfs tmp && \
sudo chown $USER:$USER tmp &&
./imagine-all-the-people.py
```
ulimit -Sv 500000
mkdir -p tmp
sudo umount tmp
sudo mount -t tmpfs -o size=3g tmpfs tmp
sudo chown $USER:$USER tmp
cd tmp
../many-commits.py
```
The tags can be used to push by parts to GitHub, which does not accept 1M at once:
remote='[email protected]:cirosantilli/test-many-commits-1m.git'
for i in `seq 10 10 100`; do
git --git-dir=tmp/repo.tmp/.git push -f "$remote" "$i:master"
done
# TODO for some reason I needed this afterwards.
git --git-dir=tmp/repo.tmp/.git push "$remote" 'master'
```
remote='[email protected]:cirosantilli/test-many-commits-1m.git'
for i in `seq 10 10 100`; do
git --git-dir=tmp/repo.tmp/.git push -f "$remote" "$i:master"
done
# TODO for some reason I needed this afterwards.
git --git-dir=tmp/repo.tmp/.git push "$remote" 'master'
```
"""

import datetime
Expand All @@ -30,11 +36,16 @@

import util

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

util.init()

# https://stackoverflow.com/questions/9905257/git-push-fatal-unable-to-create-thread-resource-temporarily-unavailable
subprocess.run(['git', 'config', '--local', 'pack.windowMemory', '50m'])
subprocess.run(['git', 'config', '--local', 'pack.packSizeLimit', '50m'])
subprocess.run(['git', 'config', '--local', 'pack.threads', '1'])

tree = util.create_tree_with_one_file()
commit = None
if len(sys.argv) > 1:
Expand All @@ -59,7 +70,7 @@
print(datetime.datetime.now())
# Lose objects are too large and blow up the tmpfs.
# Does clean packets, but the calculation takes more and more memory,
# and slows down and blows up at the end. TODO which subcommand blows up eactly?.
# and slows down and blows up at the end. TODO which subcommand blows up exactly?.
#subprocess.check_output(['git', 'gc'])
subprocess.check_output(['git', 'repack'])
subprocess.check_output(['git', 'prune-packed'])
Expand Down

0 comments on commit eee1549

Please sign in to comment.