diff --git a/other-test-repos/filter-repo.py b/other-test-repos/filter-repo.py index 0ff2a0e..aa8b5b9 100755 --- a/other-test-repos/filter-repo.py +++ b/other-test-repos/filter-repo.py @@ -12,7 +12,7 @@ def blob_callback(blob, callback_metadata): args = git_filter_repo.FilteringOptions.default_options() args.force = True args.partial = True -args.refs = ['HEAD'] +args.refs = ['HEAD~..HEAD'] args.repack=False args.replace_refs='update-no-add' diff --git a/other-test-repos/many-commits-octopus-fast-import.py b/other-test-repos/many-commits-octopus-fast-import.py new file mode 100755 index 00000000..56ff43a --- /dev/null +++ b/other-test-repos/many-commits-octopus-fast-import.py @@ -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))