-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
625747a
commit 0998fe5
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python | ||
|
||
''' | ||
This is a superior and simpler alternative to many-commits.py. | ||
Usage: | ||
rm -rf many-commits.tmp | ||
mkdir -p many-commits.tmp | ||
cd many-commits.tmp | ||
git init | ||
../many-commits-fast-import.py [ncommits=10] | git fast-import | ||
Lenovo ThinkPad P51 SSD generation time for 2M commits: 33s. Disk usage: 270.2 MiB. Push size is smaller for some reason. | ||
''' | ||
|
||
import sys | ||
|
||
print('''blob | ||
mark :1 | ||
data 1 | ||
a | ||
reset refs/heads/master | ||
commit refs/heads/master | ||
mark :2 | ||
author <> 0 +0000 | ||
committer <> 0 +0000 | ||
data 1 | ||
M 100644 :1 a | ||
''') | ||
|
||
if len(sys.argv) > 1: | ||
n = int(sys.argv[1]) | ||
else: | ||
n = 10 | ||
for i in range(2, n + 2): | ||
print('''commit refs/heads/master | ||
mark :{} | ||
author <> {} +0000 | ||
committer <> 0 +0000 | ||
data 1 | ||
from :2 | ||
'''.format(i + 1, i - 2)) | ||
print('''commit refs/heads/master | ||
mark :{} | ||
author <> 0 +0000 | ||
committer <> 0 +0000 | ||
data 1 | ||
from :3'''.format(n + 3) | ||
) | ||
for i in range(4, n + 3): | ||
print('merge :{}'.format(i)) |