-
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.
other-test-repos/many-commits-fast-import.py
- Loading branch information
1 parent
eee1549
commit 37e5c34
Showing
3 changed files
with
50 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,45 @@ | ||
#!/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 + 1): | ||
print('''commit refs/heads/master | ||
mark :{} | ||
author <> 0 +0000 | ||
committer <> 0 +0000 | ||
data 1 | ||
from :{} | ||
'''.format(i + 1, i)) |
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